Valhalla Legends Forums Archive | Visual Basic Programming | Problem

AuthorMessageTime
David
I run my bot, and when i exit it, i ctrl + alt + del , and then the bot is still in there....how do i fix this?
March 26, 2004, 5:59 PM
Networks
Private Sub Form_Unload
Unload Me
End
End sub

*Make sure you unload the rest of the forms you: Unload FrmExample

March 26, 2004, 6:07 PM
Dyndrilliac
End is a catch-all for any forms still running. Just make End on whatever procedure you want the program to close on.
March 27, 2004, 2:30 AM
Spht
[quote author=Networks link=board=31;threadid=6003;start=0#msg51835 date=1080324471]
Private Sub Form_Unload
Unload Me
End
End sub

*Make sure you unload the rest of the forms you: Unload FrmExample


[/quote]

Note that Unload <object> is what triggers Form_Unload, so calling it again is redundant. Avoid using End since it kills process without cleaning up any used memory. On unload, you should free all the memory you were using up by unloading any other forms which are running, clear arrays, terminate classes (VB may handle this automatically for you, not sure off hand), etcetera.
March 27, 2004, 4:08 AM

Search