Can the “Application Error” dialog box be disabled?

前端 未结 6 1905
鱼传尺愫
鱼传尺愫 2020-11-29 05:14

I am using Hudson as a continuous integration server to test C/C++ code. Unfortunatly, I have a bug somewhere that causes memory corruption, so on some Windows machines I w

相关标签:
6条回答
  • 2020-11-29 05:15
    1. Use "Disable error reporting", as Mr. Gently suggests. See also this PC World article.
    2. If you happen to have MS Visual Studio on your build machine, it will catch Application Errors and pop up a dialog box. To disable these dialogs (and also the Just-In-Time Debugging feature of Visual Studio), run the command drwtsn32.exe -i to set Dr. Watson as the default system debugger. Dr. Watson will generate a core dump and silently exit. (See this Microsoft Knowledge Base article: http://support.microsoft.com/kb/q121434/.)
    0 讨论(0)
  • 2020-11-29 05:19

    Use a try/catch statement to catch the exception and handle it the way you want.

    0 讨论(0)
  • 2020-11-29 05:26

    In addition to what rkb said, if you are running Windows XP 64bit, there are two sets of values. The ones in the usual registry location and the ones under the Wow6432Node key in HKLM. In order to update both, run drwtsn32.exe -i from both %SYSTEMROOT%\system32 and %SYSTEMROOT%\SysWOW64.

    0 讨论(0)
  • 2020-11-29 05:32

    Disable error reporting via:

    • Registry editing -- add your application to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting\ExclusionList, OR
    • Right-Click on My Computer, go to the Advanced Tab, and choose the "Disable error reporting" option, OR
    • You can navigate to the services console in Administrative tools, find the Error Reporting Service, go into properties and disable it
    0 讨论(0)
  • 2020-11-29 05:39

    You can use the various _CrtSetReport functions to control the way the C/C++ runtime responds to various errors (_CrtSetReportHook, _CrtSetReportMode, _CrtSetReportFile, _CrtSetReportHook2)

    0 讨论(0)
  • 2020-11-29 05:41

    You can also do something like this programaticaly using SetErrorMode. See this article for more details.

    A simple example of how to use it is to do the following:

    SetErrorMode(GetErrorMode () | SEM_NOGPFAULTERRORBOX);
    

    The above 'ORs' the current mode with our desired addition.

    0 讨论(0)
提交回复
热议问题