473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

vc++ service needs to suppress application error dialog

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
Nov 17 '05 #1
2 3158
Try this :-

SetErrorMode(SetErrorMode(SEM_NOGPFAULTERRORBOX) | SEM_NOGPFAULTERRORBOX);

There is no GetErrorMode, which is why the seemingly redundant call to
SetErrorMode twice :-)

--
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... */
"m11533" <m1****@discussions.microsoft.com> wrote in message
news:F7**********************************@microsof t.com...
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

Nov 17 '05 #2
Thus far this appears to be working great! Thanks.
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Scott A. Jones | last post by:
I have an Access front end connecting to an SQL Server back-end. When the application opens, I run a small test to determine if the SQL Server is available. If it is not, I have code to trap the...
3
by: MD Websunlimited | last post by:
I'm having a problem utilizing a control that was created in VB 6 sp6 in VC 7 (unmanged). The VC7 is a dialog based application that uses the control. The control work perfectly in a VB test form but...
4
by: Dan Diephouse | last post by:
I am attempting to write a DLL which wraps C# code. The issue at hand is a print driver allows you to extend it by writing a DLL. Seeing that VC++ seems to be hopelessly out of my mental reach, I...
3
by: Fergus Cham | last post by:
Dear All, I'm writing a VB.NET application to automate the process in Excel file. I wanna know how to suppress the prompting of Excel Error Message and write to logfile instead. Thanks &...
0
by: JT | last post by:
Hi, I've just realized that I'm not as smart as I thought I was. I have no problem creating Windows apps, class libraries, using windows references, etc. But, I absolutely cannot create and...
2
by: samir.kuthiala | last post by:
I do some requests in the background on a page using the XMLHttpRequest object. My site uses NTLM Authentication. However if the user is not logged in, it throws up an ugly dialog box. Is there...
4
by: Jason Richmeier | last post by:
I am sure this has been asked at least once before but I could not find anything when searching. If I set the value of the ExitCode property to 1066 for a windows service, the text "A service...
2
by: brianflannery | last post by:
Greetings! My situation is this. I currently have a database of which in a form displays jpeg pictures (one at a time) which are linked to the db and stored in a separate folder. I have set up a...
2
by: ZeeHseez | last post by:
Hi, I have written a webbrowser application in VB .net Framework 1.1. I would like to suppress javascript error messages. However, the silent property of the webbrowser control suppresses the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.