I have written an application that runs as a subprocess of a service, where the service is a .NET C# Windows Service that simply starts the subprocess and then periodically checks that the subprocess is still running, restarting it if it have stopped.
The problem is that the application is occasionally crashing, and when it crashes it gets hung up waiting on an Application Errror dialog.
How, from the c++ code of the application, do I ensure that any and all errors never cause a dialog to be displayed, and wait for user input? This really is a service that must run unattended. If the application crashes, I just want it to terminate and let the wrapper service notice the crash and restart the application.
Thank you very much for your prompt assistance with this.
-M
Try this :-
SetErrorMode(SetErrorMode(SEM_NOGPFAULTERRORBOX) | SEM_NOGPFAULTERRORBOX);
There is no GetErrorMode, which is why the seemingly redundant call to
SetErrorMode twice :-)

Signature
Regards,
Nish [VC++ MVP]
http://www.voidnish.com /* MVP tips tricks and essays web site */
http://blog.voidnish.com /* My blog on C++/CLI, MFC, Whidbey, CLR... */
> I have written an application that runs as a subprocess of a service, where the service is a .NET C# Windows Service that simply starts the
subprocess and then periodically checks that the subprocess is still
running, restarting it if it have stopped.
> The problem is that the application is occasionally crashing, and when it crashes it gets hung up waiting on an Application Errror dialog.
>
> How, from the c++ code of the application, do I ensure that any and all errors never cause a dialog to be displayed, and wait for user input? This
really is a service that must run unattended. If the application crashes, I
just want it to terminate and let the wrapper service notice the crash and
restart the application.
> Thank you very much for your prompt assistance with this.
>
> -M
m11533 - 30 Jul 2004 18:15 GMT
Thus far this appears to be working great! Thanks.