[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?
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.
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.
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.