Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / July 2004

Tip: Looking for answers? Try searching our database.

vc++ service needs to suppress application error dialog

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
m11533 - 30 Jul 2004 00:02 GMT
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
Nishant S - 30 Jul 2004 04:46 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.