Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 362
Anteru Avatar asked Nov 23 '08 08:11

Anteru


1 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

  • http://msdn.microsoft.com/en-us/library/ms680621(VS.85).aspx
like image 138
wimh Avatar answered Sep 18 '22 12:09

wimh