Catch "The program stopped working" on Vista

On Vista, I got a problem with the application crash handler. Basically, if something unexpected occurs which cannot be captured by SEH, I get this pop-up window with "The application stopped working", blablabla, "Close program/Debug program" -- that is, after I disable the error reporting using the system control panel. With error reporting enabled, you would get a task dialog with search for solution online, close, debug.

This is not so funny if it happens in automated tools, and I wonder whether there is a way to get rid of it totally, read, if my app crashes, it just crashes to the command line or disappears but does not bring up a dialog.

Answers


Use

SetErrorMode(SetErrorMode(0)|SEM_NOGPFAULTERRORBOX);

But I would suggest to install an exceptions handler which creates a dump so you can verify what happened. For example crashrpt (or here).

See also


Function signal works on all POSIX platforms:

signal(SIGSEGV, &signal_handler);

If you need to trap an exception that isn't supported by signal, you can also take a look at AddVectoredExceptionHandler, a function specific to W32.


Need Your Help

Is there a drupal function to jump out of the page rendering process and return a page not found?

php drupal drupal-6

I would like to have the choice in a variable_load function (as used to load variables from menu arguments) to circumvent the remainder of the page rendering process and give the user a "page not f...

How can I create a Word document using Python?

python xml xslt ms-word

I'd like to create a Word document using Python, however, I want to re-use as much of my existing document-creation code as possible. I am currently using an XSLT to generate an HTML file that I