Discussion Locked

VB6 exe termination

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
When I exit or end Order.exe, an application written in VB6, I still see it registered in the user's task manager as still running. What should I do to avoid this situation?

7 replies

by rrv

The application if VB6 based, the single thread is not closed. Probably the developer would have closed all forms and connections but did not use "End" in the code. As a general practice in VB6 developer should close all used objects and set it to nothing. DB Connections objects have to be only closed not set to nothing[pooling takes care] and end of program should close all open objects, forms, controls and COM references and ultimately END.
All the best
RV

by jmiller1

Most times when this happens a form in the program has been loaded into memory, but not unloaded. When your main form is being closed, it is usually best to place code in the 'Query_Unload' event to unload all the forms in the program to make sure it shuts down cleanly.

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Unload frmDataform
Unload frmSplash
'Finally, unload the main form
Unload frmMain
End Sub

This will make sure no forms are left in memory and everything is shut down cleanly.

Joe

by sl-campbell

Also, if you have a proceedure that calls a 2nd proceedure to end the program, and the first proceedure has code after that call, you may run into problems. A circular reference could also cause the problem.
Most, alot of the time, it is only something like a DataReport not being closed. See if one is still opened in the background hidden, and close it first.

This discussion is closed to new replies.