Application wont exit

A

Arthur Dent

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.
 
G

Guest

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
 
A

Arthur Dent

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top