Ending an application

fredy989q
08-09-2005, 10:45 AM
I have a small program whose main page does a little setup and then waits for a menu jump to another page or for a communications interrupt.

I used the menu editor to create a mnuExit to close the application. If I explicitly unload the other forms in response to this event it will end all tasks. But if not it seems to just keep running.

I also have a Control Box enabled on the main page and when I run the app and click the X the form disappears from the screen but the task continues to run! I have to use the task manager to stop the app.

Any idea what is going on here?

LaVolpe
08-09-2005, 11:18 AM
I would guess that you have other forms or controls/classes still loaded. Consider calling your mnuExit click event from your main form's UnLoad event. VB will continue to run in as long as other forms, and/or any classes, usercontrols, etc they may be referencing, are still Loaded.

fredy989q
08-09-2005, 11:58 AM
I would guess that you have other forms or controls/classes still loaded. Consider calling your mnuExit click event from your main form's UnLoad event. VB will continue to run in as long as other forms, and/or any classes, usercontrols, etc they may be referencing, are still Loaded.
Good answer! I don't know how I have not been burned by this before!

loquin
08-09-2005, 02:05 PM
BTW: Before anyone recommends it, DON'T use the end statement. The end statement forces a shutdown, that is true. But, it bypasses VB's orderly shutdown, so you often end up with a memory leak in your app.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum