exit-handler

Shut down a ATL application cleanly

Hi all, I am a complete newbie to C++ so bear with me ;-) I have developed a console ATL application and want to trap the close?, exit?, terminate? event so that I can close log files and perform a general cleanup on exit. How can I trap the 'terminate' event that would result from someone ending the .exe in the task manager? Appreci...

Does Application.ApplicationExit event work to be notified of exit in non-Winforms apps?

Our code library needs to be notified when the application is exiting. So we have subscribed to the System.Window.Forms.Application.ApplicationExit event. This works nicely for Winforms apps, but does it also work for other types of applications such as console apps, services, and web apps (such as ASP.NET)? The namespace would suggest...

How do I write an exit handler for an F# application?

Subject says it all. I want some code to run if my application is terminated by, say, ^C. ...