VB 2003. I cant find the last thing im missing.
I click the "Run" button to run my app in VB.net and it runs.
But when i close the application, the thread does not end ( i think )
because it never ends the debuger
and i have to hit the "little square" to stop the app.
If make a shortcut to the exe and run it that way, it stays in the Windows
Task Manager and I have to kill the process.
Has anyone else run into this / work around?
My thread opens a udp port and listens for data on a port. ( but i dont
think that matters )
For the example I used to create this, it is:
http://www.codeproject.com/vb/net/UDP_Send_Receive.asp
On FormLoad i open a new thread:
ThreadReceive = _
New System.Threading.Thread(AddressOf A_Sub )
ThreadReceive.Start()
===
then in the
Public Sub A_Sub
'I do stuff
EndSub
===
Then on form Close I call
MessageBox.Show( "yes i am closing the application" )
ThreadReceive.Suspend() 'Both of these or just 1 of these alone does not
work
ThreadReceive.Abort()
messagebox.show( "the thread should have stopped but it didnt and the app is
still in Windows Task Manager and never leaves the debuger." )
Thanks,
Miro