1

From my application, I use a COM API to make calls to another application. This results in the other application starting up in its own process and doing some things. Sometimes, these things go badly and the application explodes. I handle the error coming back from COM just fine; but, the other application process crash causes a dialog to popup on the machine, asking if the process should be killed, or help sent to Microsoft, or something. This server is not monitored; there's nobody there. How do I suppress this dialog when it occurs on someone else's app?

GWLlosa
  • 23,995
  • 17
  • 79
  • 116
  • Is it the same question http://stackoverflow.com/questions/396369/how-do-i-disable-the-debug-close-application-dialog-on-windows-vista ? – Oleg Pavliv Mar 14 '11 at 19:02
  • Its not quite the same question, since the code here is NOT under my control. – GWLlosa Mar 14 '11 at 20:23

1 Answers1

0

Take a look at Debugging Functions on MSDN. I haven't tested the approach, but I think you should be able to achieve what you want by using DebugActiveProcess, WaitForDebugEvent, ContinueDebugEvent and FatalExit. The idea would be to wait for a debug event and if it's the one you want -- in this case, an unhandled exception (dwFirstChance in EXCEPTION_DEBUG_INFO is zero) -- terminate the process with FatalExit, otherwise continue execution with ContinueDebugEvent.

Like I said, it's just an idea, I haven't tested it. Also, Oleg's advice is much simpler if you don't mind disabling the Windows Error Reporting dialog box for the whole machine.

Vojislav Stojkovic
  • 8,043
  • 4
  • 35
  • 48