The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

How do you exit an application clenly?

Hi Guys,

Need help.. 

need a way to have my application closed cleanly.. meaning  if there are any forms in memory or anything open just kill and close app.

i use  application.exit

but if i have previously opened any forms..  even if i call the formname.close    then  application.exit.  it still makes the opened forms in memory flicker on the window..

and the application still runs in the taskmanager process tab.  need help..

any one have a function written that I can use to exit an application cleanly?
Thursday, October 12, 2006
Letting us know the development environment will help
Marcus from Melbourne
Thursday, October 12, 2006
First off what language are you using? I have no idea what you mean by "application.exit".
Jeff Williams
Thursday, October 12, 2006

Thursday, October 12, 2006
Application.exit is fine in VB.Net provided that you do not have MULTIPLE instances of the application open because you create a new process for each new instance of the app that is open.

In VS 2005, there is, however, a configuration that disallows the user the ability to open multiple instances of your app.

The only other issue that may convolute closing an app after the fact is if you have an unresolved multithreaded process running during an application's closing event.

I'm not quite sure what the implication here is because I've not created multi-threaded apps but I imagine that it may be a problem if they are not coded properly.
Brice Richard Send private email
Friday, October 13, 2006
Examine your stack via the debugger at the point where the user elects to exit.  Follow up the call chain, putting a conditional in there to permit it to exit cleanly.

I suspect that your architecture is a bit, ummm, ad-hoc, which is why you think it's complicated.  Generally your main form's controller will have a collection of all the open form/controller combinations, and will send each of them a "I'd like to close now, if you please, so save your data!" message, and then self-destruct.
xampl Send private email
Sunday, October 15, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz