473,803 Members | 4,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3173
Try this :-

SetErrorMode(Se tErrorMode(SEM_ NOGPFAULTERRORB OX) | SEM_NOGPFAULTER RORBOX);

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****@discuss ions.microsoft. com> wrote in message
news:F7******** *************** ***********@mic rosoft.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
13540
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 'On Error' event. Unfortunately, a 'SQL Server Login' dialog appears before my 'On Error' code has a chance to run. Does anybody know how to prevent the dialog from appearing? Suppressing warnings (DoCmd.SetWarnings FALSE) has no effect. ...
3
1446
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 I can not get it to work in VC7. Whenever a property is accessed a memory access exception is produced. When I attempt to add a variable to the control I get an error saying that IExtender is not available. Is there something I'm missing...
4
1464
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 thought I'd write the DLL in C#. Of course, it turns out I can't solely write the DLL in C# managed code. I have to create an unmanaged wrapper. So I have the following stub below which I need to fill in. I've gotten to the point where it...
3
2856
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 & Best regards, Fergus
0
1451
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 use a web service and Windows application pair in VS 2005, even following the walkthrough in Help. There are differences in some of the steps they outline that I assume are due to an old example and I am using VS 2005. On my latest attempt I...
2
10785
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 any way to suppress this? I am ok with the object throwing an error which I can catch. What I want to do is to make a request. Instead of it popping up a dialog box, I want to be able to suppress this dialog and instead forward him to a...
4
6813
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 specific error occured: 0." How do I (if it is possible) change the value of the zero to something custom (like a "look in the event log for further information" message)? Thank you,
2
2440
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 report with an image control do display/print 4 pictures on a page. When the report opens (in preview mode) the "loading image" dialog flashes 4 times (once for each picture) which isn't a huge deal, but is annoying. There have been several...
2
6648
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 Javascript messages, but it also blocks any other dialog box, such as Login dialog, i can't use the silent property. I used http://support.microsoft.com/default.aspx?scid=kb;EN-US;279535 article to suppress the error messages. It works fine until a...
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5629
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.