-
February 25th, 2011, 03:40 PM
#1
[RESOLVED] Catching when an application closes/crashes..in release mode.
I have an app that will run for a variable amount of time and then...disappear.
Usually, when this application crashes (it does happen), I'll get a "Windows has encountered an error and needs to close..." window. I'm also catching issues in debug mode, but I also need to test in release.
Is there a way to intercept and log this disappearing act? I'm thinking of writing to a log file on this event when the app "disappears" but I haven't yet determined what function, exactly, I should look for.
Can someone shed some light on this problem?
-
February 25th, 2011, 04:49 PM
#2
Re: Catching when an application closes/crashes..in release mode.
Wrap main in a try/catch block and log the exception and stack trace. Next time it crashes you know where to start looking.
-
February 26th, 2011, 01:32 PM
#3
Re: Catching when an application closes/crashes..in release mode.
http://msdn.microsoft.com/en-us/libr...exception.aspx
That is what you need. It'll allow you to log information on any unhandled exception.
www.monotorrent.com For all your .NET bittorrent needs
NOTE: My code snippets are just snippets. They demonstrate an idea which can be adapted by you to solve your problem. They are not 100% complete and fully functional solutions equipped with error handling.
-
February 28th, 2011, 11:12 AM
#4
Re: Catching when an application closes/crashes..in release mode.
Thank you both for all your help! Mutant Fruit, that link was exactly what I was looking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|