Process does not terminate

S

san

Hi,

I have a C# windows application App.exe that uses a UI
component from another dll that components.dll. Everything
works fine except that when I close the window of App.exe
the process does not terminate (I can see App.exe is the
task manager). Also, I tried to see if control was
returned to Main() after closing the UI (since
Application.Run( myForm ) is used control should be
returned to Main() once the UI is closed. This does not
seem to happen.

I have resorted to Process.GetCurrentProcess().Kill().
This is not a correct/elegant solution. Any suggestions?

Regards,
Sandeep
 
C

Chris LaJoie

I don't believe that is what I would call 'elegant'. I have had a similar
problem with my app using several threads and a UI component in a dll, but I
couldn't get it to happen consistantly. Are you using any COM interop in
your app? I believe that my problems could have stemmed from that.

Just FYI, I'm not sure if the GC will clean up after you if you forcefully
terminate an app that way. I haven't read up on the GC and it's functions,
so I'm no expert. It might be worth looking into though, if you're going to
be using that "hammer" to close your app.

Chris
 

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