Newbie - Help, Can't kill app!

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I wrote a simple VB program that runs.
When I click on the close button in the upper right hand corner
of the main windows, the program closes. Or at least it appears to.
If I look in the Task List manager, I can still see my app TTEST.EXE running.
If I start it up again, I get a second instance of TTEST.EXE running.

I thought that if I call Application.Exit this would kill the task but it does not.
How do I properly close my program so that it kills the task?

Here is my startup code.

Public Class Startup
Private Shared m_MainForm As MainTabForm

' This class is created so that I take control of the Mainform from VB.net
' This gives me global access to all members of the form

Public Shared ReadOnly Property MainForm() As MainTabForm
Get
Return m_MainForm
End Get
End Property

Public Shared Sub Main()
m_MainForm = New MainTabForm
Application.Run(m_MainForm) ' Run my MainForm Windows
m_MainForm.Close()
Application.Exit()
End Sub

End Class
 
Hi,


You dont need these lines. Once you click on the close button the
form closes you dont need to need to do it with code also. Are you sure
there isn't any code preventing the form from closing.

m_MainForm.Close()
Application.Exit()


Ken
----------------------------
I wrote a simple VB program that runs.
When I click on the close button in the upper right hand corner
of the main windows, the program closes. Or at least it appears to.
If I look in the Task List manager, I can still see my app TTEST.EXE
running.
If I start it up again, I get a second instance of TTEST.EXE running.

I thought that if I call Application.Exit this would kill the task but it
does not.
How do I properly close my program so that it kills the task?

Here is my startup code.

Public Class Startup
Private Shared m_MainForm As MainTabForm

' This class is created so that I take control of the Mainform from
VB.net
' This gives me global access to all members of the form

Public Shared ReadOnly Property MainForm() As MainTabForm
Get
Return m_MainForm
End Get
End Property

Public Shared Sub Main()
m_MainForm = New MainTabForm
Application.Run(m_MainForm) ' Run my MainForm Windows
m_MainForm.Close()
Application.Exit()
End Sub

End Class
 
There is nothing preventing the form from closing. The Form is
closing.
However, the program TTEST.exe is staying in memory. In the Windows
Task Manager it is there until I have the task manager explicitly kill
it.

Bob
 
Hi,

Reread the orginal post. You cant have an application startup
object as sub main in a class. What is the startup object? Where do you
create an class startup? Post more code.

Ken
--------------------


There is nothing preventing the form from closing. The Form is
closing.
However, the program TTEST.exe is staying in memory. In the Windows
Task Manager it is there until I have the task manager explicitly kill
it.

Bob
 
Ken, can you explain that more? Why can't your Sub Main be in a class? His
shared Sub Main() looks equivalent to placing Sub Main() in a Module to me.

Greg
 
Back
Top