Debugger doesn't stop running when application exits

G

Guest

Hello.

I am writing a PocketPC 2002 app using C# and Visual Studio .NET 2003. I have disabled "Smart Minimize" by setting my MinimizeBox property to false.

When I click the "OK" button, I am trapping the Closed event for my form. When I step through, after the form closed event, my code returns from Applicaton.Run() and leaves the Main function. If I then look on my PocketPC device at the running programs, my application is NOT listed. However, then Visual Studio .NET 2003 debugger does not stop running. I am forced to hit the "Stop" button. This then causes the machine to "hold open" the EXE that it makes, so if I want to deploy the project again to the device, I have to shut down my IDE and do it again. This is unacceptable

I have downloaded a sample application (the Serial Communications Sample) from Microsoft and I am setting up my project and Main form the same way the sample does (as far as I can tell), but in their sample, when the OK button is pressed, the application AND the debugger stop. This is the behavior I require

Can anyone make suggestions? If you need more info, please let me know and I will get it for you. Thanks in advance!
 
C

Chris Tacke, eMVP

Something in the App is still running. Are you launching any threads?
Calling Application.Exit() in the Form.Close() event will take care of the
problem.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Brent Lang said:
Hello.

I am writing a PocketPC 2002 app using C# and Visual Studio .NET 2003. I
have disabled "Smart Minimize" by setting my MinimizeBox property to false.
When I click the "OK" button, I am trapping the Closed event for my form.
When I step through, after the form closed event, my code returns from
Applicaton.Run() and leaves the Main function. If I then look on my
PocketPC device at the running programs, my application is NOT listed.
However, then Visual Studio .NET 2003 debugger does not stop running. I am
forced to hit the "Stop" button. This then causes the machine to "hold
open" the EXE that it makes, so if I want to deploy the project again to the
device, I have to shut down my IDE and do it again. This is unacceptable.
I have downloaded a sample application (the Serial Communications Sample)
from Microsoft and I am setting up my project and Main form the same way the
sample does (as far as I can tell), but in their sample, when the OK button
is pressed, the application AND the debugger stop. This is the behavior I
require.
Can anyone make suggestions? If you need more info, please let me know
and I will get it for you. Thanks in advance!
 
G

Guest

Thank you, that worked

Since I am using Microsoft's same Serial class, there are other threads running. However, I did try commenting out all references to the class trying to avoid the threads from spawning. I did add that call to Applicaton.Exit where you suggested and it worked. Thank you
 
C

Chris Tacke, eMVP

Just FYI, the MSDN Serial sample code is a bit dated. We've made some mods
and significant bug-fixes since it was published, so getting the latest may
be a good idea.

www.opennetcf.org

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


Brent Lang said:
Thank you, that worked.

Since I am using Microsoft's same Serial class, there are other threads
running. However, I did try commenting out all references to the class
trying to avoid the threads from spawning. I did add that call to
Applicaton.Exit where you suggested and it worked. Thank you
 

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