I've looked up a number of articles and forum posts about detecting bad pointers and other memory violations and it occured to me that a segfault (I assume that the "This program has stopped responding and needs to be closed" provided by Windows is the same thing) is enough of an indicator of a problem.

However, to the end user should a segfault happen and the progam just hang and 'stop responding', it's irritating to have to force it closed and not have the program say anything at all about what the problem was.

Is there a way that I could 'gracefully crash' (e.g., have the program basically say "Ooops, I'm screwed. Here's a stack trace for the dev's." rather than explode inexplicably) that I can implement using Microsoft's compiler? I know that I can do this rather simply using GCC based compilers (http://stackoverflow.com/questions/7...g-gcc-compiler) using signal hooks and plan to implement that code in the Mac/Linux versions of the program but I'm using VC++ for the Windows version.

Is there a similar method for microsoft based compilers?