General discussion

Locked

VB6 exe termination

By setivi ·
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?

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB6 exe termination

by RRV In reply to VB6 exe termination

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

Collapse -

VB6 exe termination

by setivi In reply to VB6 exe termination

Poster rated this answer

Collapse -

VB6 exe termination

by jmiller1 In reply to VB6 exe termination

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

Collapse -

VB6 exe termination

by setivi In reply to VB6 exe termination

Poster rated this answer

Collapse -

VB6 exe termination

by sl-campbell In reply to VB6 exe termination

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.

Collapse -

VB6 exe termination

by setivi In reply to VB6 exe termination

Poster rated this answer

Collapse -

VB6 exe termination

by setivi In reply to VB6 exe termination

This question was closed by the author

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums