all groups > dotnet compact framework > june 2006 >
You're in the

dotnet compact framework

group:

Application wont exit


Application wont exit Arthur Dent
6/29/2006 12:19:13 PM
dotnet compact framework:
Hello All,

Im having a problem getting my app to unload from memory. it starts with a
sub main, that essentially goes:

Dim f as myForm
f.ShowDialog()
Application.Exit

now, it IS getting to the application.exit statment (tested with a MsgBox
statement earlier), but it just WONT
unload. It LOOKS like it does, all the forms go away, and if i check the
Running Programs list, it is not listed
anymore, but the terminal just sits there with its little "hourglass" thing
going and going ..... and it maintains a
lock on the executable file.
Very frustrating for development because i have to reset the device before i
can copy on a new version,
which means having to re-establish a stupid activesync connection too.
Rather tedious.

Any idea why it would not exit even though it appears to? VS2005, CF 2

Thanks in advance,
Arthur Dent.

Re: Application wont exit ctacke/
6/29/2006 1:03:47 PM
Fist Ill go on record as saying that's not a very good way to exit. To exit
an app you should always try to close the Form instance passed to
Application.Run.

In this case my thought is that your myForm instance is causing grief with
it's own message pump and the process is waiting for it to get cleaned up
before exiting. Forms shown with ShowDialog aren't disposed (by design) when
closed, so try this:

Dim f as myForm
f.ShowDialog()
f.Dispose()
Application.Exit


--
Chris Tacke
OpenNETCF Consulting
www.opennetcf.com
--



[quoted text, click to view]

Re: Application wont exit Arthur Dent
6/29/2006 1:52:44 PM
Okay, i fixed it.... you put me on the right track, thanks.
I believe it was the Symbol barcode component which was not automatically
disposing itself.
Did a dispose on that thing and now it works. GREAT,THANKS!


[quoted text, click to view]

AddThis Social Bookmark Button