Question

I have a program in Windows CE 5.0 created in Visual Studio 2008. Opening the application I created works fine but when I close the application with:

Application.Exit()

I cannot open another application, I cannot even open the same application again.

Any idea what about closing the program properly? I have also tried using

Me.Close()

or

Environment.Exit()
Was it helpful?

Solution

cannot open another application, I cannot even open the same application again.

Looks like your application does not exit and 'blocks' the GUI. Or what exactly does the above mean? Can click the start button and a menu opens?

If your app uses background thread, the app will not close correctly until these threads are terminated too. You will have the app still in the process list but no GUI, the app seem to have terminated but it did not.

If you have background threads you have to terminate them BEFORE you Exit the application.

Background threads can be terminated using Thread.Abort() or using a condition in a while loop. For the thread.avort you have to code the lines of the background thread within a try/Catch block and catch for the ThreadAbortException.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top