Debug

starcraft

Well-known member
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
When i debug it loads up fine then just closesjust before its about to bring up my program and in the log window it says
The program [3644] WindowsApplication16.exe has exited with code 0 (0x0).
how do i fix it?
 
Is this program being started from a Sub Main() (using Application.Run) or is it just a standard startup form?
 
Code:
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        This call is required by the Windows Form Designer.
        InitializeComponent()

        Add any initialization after the InitializeComponent() call

    End Sub

    Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    NOTE: The following procedure is required by the Windows Form Designer
    It can be modified using the Windows Form Designer.  
    Do not modify it using the code editor.
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Button3 As System.Windows.Forms.Button
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Button3 = New System.Windows.Forms.Button()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        
        Label2
        
        Me.Label2.Location = New System.Drawing.Point(0, 104)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(296, 192)
        Me.Label2.TabIndex = 1
        Me.Label2.Text = "You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threaten" & _
        "ing, sexually-oriented or any other material that may violate any applicable law" & _
        "s. Doing so may lead to you being immediately and permanently banned (and your s" & _
        "ervice provider being informed). The IP address of all posts is recorded to aid " & _
        "in enforcing these conditions. You agree that the webmaster, administrator and m" & _
        "oderators of this forum have the right to remove, edit, move or close any topic " & _
        "at any time should they see fit. As a user you agree to any information you have" & _
        " entered above being stored in a database. While this information will not be di" & _
        "sclosed to any third party without your consent the webmaster, administrator and" & _
        " moderators cannot be held responsible for any hacking attempt that may lead to " & _
        "the data being compromised."
        
        Label3
        
        Me.Label3.Location = New System.Drawing.Point(0, 296)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(296, 88)
        Me.Label3.TabIndex = 2
        Me.Label3.Text = "This forum system uses cookies to store information on your local computer. These" & _
        " cookies do not contain any of the information you have entered above; they serv" & _
        "e only to improve your viewing pleasure. The e-mail address is used only for con" & _
        "firming your registration details and password (and for sending new passwords sh" & _
        "ould you forget your current one)."
        
        Label4
        
        Me.Label4.Location = New System.Drawing.Point(0, 392)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(296, 40)
        Me.Label4.TabIndex = 3
        Me.Label4.Text = "By clicking Register below you agree to be bound by these conditions."
        
        Button1
        
        Me.Button1.Location = New System.Drawing.Point(0, 432)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(304, 32)
        Me.Button1.TabIndex = 4
        Me.Button1.Text = "I Agree to these terms and am over or exactly 13 years of age"
        
        Button2
        
        Me.Button2.Location = New System.Drawing.Point(0, 488)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(296, 23)
        Me.Button2.TabIndex = 5
        Me.Button2.Text = "I do not agree to these terms"
        
        Button3
        
        Me.Button3.Location = New System.Drawing.Point(0, 464)
        Me.Button3.Name = "Button3"
        Me.Button3.Size = New System.Drawing.Size(296, 24)
        Me.Button3.TabIndex = 6
        Me.Button3.Text = "I Agree to these terms and am under 13 years of age"
        
        Label1
        
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(296, 104)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "While the administrators and moderators of this forum will attempt to remove or e" & _
        "dit any generally objectionable material as quickly as possible, it is impossibl" & _
        "e to review every message. Therefore you acknowledge that all posts made to thes" & _
        "e forums express the views and opinions of the author and not the administrators" & _
        ", moderators or webmaster (except for posts by these people) and hence will not " & _
        "be held liable."
        
        Form1
        
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(296, 510)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Button3, Me.Button2, Me.Button1, Me.Label4, Me.Label3, Me.Label2, Me.Label1})
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public frm2 As New Form2()
    Public frm3 As New Form3()
    Public frm4 As New Form4()
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.AddOwnedForm(frm2)
        Me.AddOwnedForm(frm3)
    End Sub
 
There doesnt seem to be anything wrong with that, what happens in the other forms?

I had a problem similar to this before, I had accidentally got the program stuck in an infinite loop creating object instances, when the memory usage got to high the program just ended but I dont know if thats a problem here
 
Code:
Option Strict On
Option Explicit On 
Imports System.Web.Mail
Public Class Form2
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        This call is required by the Windows Form Designer.
        InitializeComponent()

        Add any initialization after the InitializeComponent() call

    End Sub

    Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    NOTE: The following procedure is required by the Windows Form Designer
    It can be modified using the Windows Form Designer.  
    Do not modify it using the code editor.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox3 As System.Windows.Forms.TextBox
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents TextBox4 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox5 As System.Windows.Forms.TextBox
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents Label7 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.Label2 = New System.Windows.Forms.Label()
        Me.Label3 = New System.Windows.Forms.Label()
        Me.TextBox2 = New System.Windows.Forms.TextBox()
        Me.TextBox3 = New System.Windows.Forms.TextBox()
        Me.Label4 = New System.Windows.Forms.Label()
        Me.TextBox4 = New System.Windows.Forms.TextBox()
        Me.TextBox5 = New System.Windows.Forms.TextBox()
        Me.Label5 = New System.Windows.Forms.Label()
        Me.Label6 = New System.Windows.Forms.Label()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.Label7 = New System.Windows.Forms.Label()
        Me.SuspendLayout()
        
        Label1
        
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(288, 32)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "You have said that you are 13 or older. Please fill out the rest of this informat" & _
        "ion and click send form at bottem."
        
        TextBox1
        
        Me.TextBox1.Location = New System.Drawing.Point(0, 48)
        Me.TextBox1.MaxLength = 25
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(296, 20)
        Me.TextBox1.TabIndex = 1
        Me.TextBox1.Text = ""
        
        Label2
        
        Me.Label2.Location = New System.Drawing.Point(0, 32)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(288, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "Enter the username you wish to have"
        
        Label3
        
        Me.Label3.Location = New System.Drawing.Point(0, 72)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(288, 16)
        Me.Label3.TabIndex = 3
        Me.Label3.Text = "Enter the password you wish to have"
        
        TextBox2
        
        Me.TextBox2.Location = New System.Drawing.Point(0, 88)
        Me.TextBox2.MaxLength = 25
        Me.TextBox2.Name = "TextBox2"
        Me.TextBox2.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.TextBox2.Size = New System.Drawing.Size(296, 20)
        Me.TextBox2.TabIndex = 4
        Me.TextBox2.Text = ""
        
        TextBox3
        
        Me.TextBox3.Location = New System.Drawing.Point(0, 128)
        Me.TextBox3.MaxLength = 25
        Me.TextBox3.Name = "TextBox3"
        Me.TextBox3.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.TextBox3.Size = New System.Drawing.Size(296, 20)
        Me.TextBox3.TabIndex = 5
        Me.TextBox3.Text = ""
        
        Label4
        
        Me.Label4.Location = New System.Drawing.Point(0, 112)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(288, 16)
        Me.Label4.TabIndex = 6
        Me.Label4.Text = "Re-Enter your password"
        
        TextBox4
        
        Me.TextBox4.Location = New System.Drawing.Point(0, 168)
        Me.TextBox4.MaxLength = 25
        Me.TextBox4.Name = "TextBox4"
        Me.TextBox4.Size = New System.Drawing.Size(296, 20)
        Me.TextBox4.TabIndex = 7
        Me.TextBox4.Text = ""
        
        TextBox5
        
        Me.TextBox5.Location = New System.Drawing.Point(0, 208)
        Me.TextBox5.MaxLength = 25
        Me.TextBox5.Name = "TextBox5"
        Me.TextBox5.Size = New System.Drawing.Size(296, 20)
        Me.TextBox5.TabIndex = 8
        Me.TextBox5.Text = ""
        
        Label5
        
        Me.Label5.Location = New System.Drawing.Point(0, 152)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(288, 16)
        Me.Label5.TabIndex = 9
        Me.Label5.Text = "Enter your e-mail address"
        
        Label6
        
        Me.Label6.Location = New System.Drawing.Point(0, 192)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(288, 16)
        Me.Label6.TabIndex = 10
        Me.Label6.Text = "Re-Enter your e-mail address"
        
        Button1
        
        Me.Button1.Location = New System.Drawing.Point(152, 240)
        Me.Button1.Name = "Button1"
        Me.Button1.Size = New System.Drawing.Size(128, 24)
        Me.Button1.TabIndex = 11
        Me.Button1.Text = "Send Form ->"
        
        Button2
        
        Me.Button2.Location = New System.Drawing.Point(8, 240)
        Me.Button2.Name = "Button2"
        Me.Button2.Size = New System.Drawing.Size(128, 24)
        Me.Button2.TabIndex = 12
        Me.Button2.Text = "Clear Form"
        
        Label7
        
        Me.Label7.ForeColor = System.Drawing.Color.Lime
        Me.Label7.Location = New System.Drawing.Point(0, 272)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(288, 16)
        Me.Label7.TabIndex = 13
        Me.Label7.Text = "Created By: Michael Dresser                          Version: 1.5"
        
        Form2
        
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.BackColor = System.Drawing.Color.Black
        Me.ClientSize = New System.Drawing.Size(292, 286)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label7, Me.Button2, Me.Button1, Me.Label6, Me.Label5, Me.TextBox5, Me.TextBox4, Me.Label4, Me.TextBox3, Me.TextBox2, Me.Label3, Me.Label2, Me.TextBox1, Me.Label1})
        Me.ForeColor = System.Drawing.Color.Red
        Me.Name = "Form2"
        Me.Text = "Form2"
        Me.ResumeLayout(False)

    End Sub

#End Region
    Public frm2 As New Form1()
    Public frm3 As New Form3()
    Public frm4 As New Form4()
    Private Sub TextBox5_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox5.TextChanged

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Select Case TextBox2.Text
            Case TextBox3.Text /// same text in textbox2 and textbox1
            Case Else /// different texts
                MessageBox.Show("oops you typed the wrong password! ")
                Select Case TextBox4.Text
                    Case TextBox5.Text
                    Case Else
                        MessageBox.Show("oops the e-mail addresses dont match")
                End Select
        End Select
        Dim message As New MailMessage()
        message.To = "darknecromancer@cox.net"
        message.From = TextBox4.Text
        message.Subject = "New Member*"
        message.Body = "Username: " & Chr(13) & TextBox1.Text & Chr(13) & "Password: " & Chr(13) & TextBox2.Text & Chr(13) & "Thay are 13 or older" & Chr(13)
        SmtpMail.SmtpServer = "smtp.west.cox.net"
        SmtpMail.Send(message)
        frm2.Hide()
        frm4.Show()


    End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""

    End Sub
End Class
this is form 2
 
Code:
Option Strict On
Option Explicit On 
Imports System.Web.Mail
Public Class Form3
    Inherits System.Windows.Forms.Form
 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
        TextBox4.Text = ""
        TextBox5.Text = ""
    End Sub
End Class
form 3
 
Check your App is set to start with Form1 not Sub Main in the project properties, I cant find anything wrong with the code
 
Back
Top