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++ / May 2004

Tip: Looking for answers? Try searching our database.

"Runtime error" message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gregor Nitsche - 25 Mar 2004 02:21 GMT
We are working on an application that runs as a service.  Due to its complexity, we occasionally experience crashes.  In the past, we have been able to simply log these crashes in our logs, create a Dr. Watson log, and automatically restart our service

Ever since we started to use VS .NET, though, we occasionally expericence an annoying problem.  Every now and then, a message box titled "Microsoft Visual C++ Runtime Library" pops up, with the following content

"Runtime Error

"Program: <name of application

"This application has requested the Runtim to terminate it in an unusual way.  Please contact the application's support team for more information.

and an "OK" button

The app doesn't exit (and hence, restart) until the OK button is pushed.  Since it typically runs unattended on a computer that doesn't even have a screen attached, this is not a happy situation.  Is there any way to disable this message box?  Any suggestions are much appreciated

Gregor Nitsch
RAF Technology, Inc
Gregor Nitsche - 25 Mar 2004 02:56 GMT
Additional info

- The service is set up to run from the system account, "Allow service to interact with desktop" is not checked
- From the documentation in MSDN, it appears that __set_error_mode() would do the trick.  However, from testing it, it appears that assert(0) always generates both output in stderr and a message box regardless of the value set
   
    ----- Gregor Nitsche wrote: ----
   
    We are working on an application that runs as a service.  Due to its complexity, we occasionally experience crashes.  In the past, we have been able to simply log these crashes in our logs, create a Dr. Watson log, and automatically restart our service
   
    Ever since we started to use VS .NET, though, we occasionally expericence an annoying problem.  Every now and then, a message box titled "Microsoft Visual C++ Runtime Library" pops up, with the following content
   
    "Runtime Error
   
    "Program: <name of application
   
    "This application has requested the Runtim to terminate it in an unusual way.  Please contact the application's support team for more information.
   
    and an "OK" button
   
    The app doesn't exit (and hence, restart) until the OK button is pushed.  Since it typically runs unattended on a computer that doesn't even have a screen attached, this is not a happy situation.  Is there any way to disable this message box?  Any suggestions are much appreciated
   
    Gregor Nitsch
    RAF Technology, Inc.
robscanlon - 13 May 2004 20:19 GMT
Any progress on this problem?  I am in the exact same situation (tryin
to run as a service but it hangs because of the popup).  Can't seem t
find any way to handle the ScriptControl exception in vb.net.

Thanks!
Rob Scanlo

-
robscanlo
DotNetJunkies User - 02 Apr 2004 03:21 GMT
Two things could be wrong.  First, a virus corrupted the file referred to in the runtime error message.  If this is the case (and this is the first thing you should try to solve this problem), run at least two separate virus checkers (I use Norton???s Anti Virus and Panda) after you have updated the programs with the newest downloads.  Run the virus program you have on your hard drive in Safe Mode (this sometimes eliminates viruses that can???t be deleted in normal mode).
After you are sure your disk is virus free, check and see if this eliminated the error and the problem caused by the error (it probably didn???t, right?).
Second, run System File Checker.  This is a program that not only checks for corrupted/missing files, but fixes them.  Start SFC from the Start/Run command.  Type in sfc /scannow (remember to put a space between the c and the forward slash).  After the program finishes running, reboot your computer.
This fix has worked in the majority of the runtime error cases I???ve experienced.  Sometimes, it doesn???t work and you???ll have to dig a little deeper to find the cause.
(In my latest runtime error case, I had the following message:  Visual C++ Runtime library error.  Program: C\Windows\explorer.exe.  Running SFC eliminated the runtime error message, but the problem with accessing disks in Explorer persisted.  I found out that the problem was with a corrupted file in Iomega zip drive software???this program substitutes it???s own drop down list when accessing a drive in Explorer/My Computer???so when I tried to, for instance, format a disk in my floppy drive the screen would go blank for a few seconds and then revert to the desktop).  I solved the problem by deleting and then reinstalling the Iomega software.
I???ve found that the problem of runtime errors can almost always be solved by just reading the entire text of the warning and then concentrating your efforts on doing everything feasible to the program in question.  If your having problems with a add-on program that can be deleted and reinstalled, do that.  If it???s a Window-based program, odds are SFC will take care of it.
If nothing you???ve tried works, then it???s time to invoke the dreaded Recovery Console fix.  I say dreaded because this program can sometimes create more problems that it solves???proceed with caution!
I hope any or all of this advice solves your problem.
Hyjanks

---
DotNetJunkies User - 02 Apr 2004 03:23 GMT
Two things could be wrong.  First, a virus corrupted the file referred to in the runtime error message.  If this is the case (and this is the first thing you should try to solve this problem), run at least two separate virus checkers (I use Norton???s Anti Virus and Panda) after you have updated the programs with the newest downloads.  Run the virus program you have on your hard drive in Safe Mode (this sometimes eliminates viruses that can???t be deleted in normal mode).
After you are sure your disk is virus free, check and see if this eliminated the error and the problem caused by the error (it probably didn???t, right?).
Second, run System File Checker.  This is a program that not only checks for corrupted/missing files, but fixes them.  Start SFC from the Start/Run command.  Type in sfc /scannow (remember to put a space between the c and the forward slash).  After the program finishes running, reboot your computer.
This fix has worked in the majority of the runtime error cases I???ve experienced.  Sometimes, it doesn???t work and you???ll have to dig a little deeper to find the cause.
(In my latest runtime error case, I had the following message:  Visual C++ Runtime library error.  Program: C\Windows\explorer.exe.  Running SFC eliminated the runtime error message, but the problem with accessing disks in Explorer persisted.  I found out that the problem was with a corrupted file in Iomega zip drive software???this program substitutes it???s own drop down list when accessing a drive in Explorer/My Computer???so when I tried to, for instance, format a disk in my floppy drive the screen would go blank for a few seconds and then revert to the desktop).  I solved the problem by deleting and then reinstalling the Iomega software.
I???ve found that the problem of runtime errors can almost always be solved by just reading the entire text of the warning and then concentrating your efforts on doing everything feasible to the program in question.  If your having problems with a add-on program that can be deleted and reinstalled, do that.  If it???s a Window-based program, odds are SFC will take care of it.
If nothing you???ve tried works, then it???s time to invoke the dreaded Recovery Console fix.  I say dreaded because this program can sometimes create more problems that it solves???proceed with caution!
I hope any or all of this advice solves your problem.
Hyjanks

---
William DePalo [MVP VC++] - 14 May 2004 01:00 GMT
> We are working on an application that runs as a service.
> Due to its complexity, we occasionally experience crashes.
[quoted text clipped - 6 lines]
> message box titled "Microsoft Visual C++ Runtime Library"
> pops up, with the following content:

I've seen this question pop up a couple of times. At the risk of sounding
too glib, the best course, of course, is to fix the problem before you
deploy. :-)

Of course we all make errors occaisionally an that is not always possible.

I'm not sure about this but I think that the message is issued in the module
"crtmbox.c" where there are these lines:

   if (fNonInteractive)
       {
           if (_winmajor >= 4)
               uType |= MB_SERVICE_NOTIFICATION;
           else
               uType |= MB_SERVICE_NOTIFICATION_NT3X;
       }

In other words, it looks as though the code specifically checks if the
caller is running on a non-interactive desktop and then sets the message box
flags so that they get displayed on the console despite the fact that a
service is involved. Again, assuming I have the cause right, there is an
implicit assumption that the error is so bad as to warrant user
intervention.

If I'm right about that, and if that's not the case for you then perhaps you
want to research ways of using a custom version of that function which does
not invoke MessageBox(). Of course, if things are _really_ bad you may not
be able to do much.

Regards,
Will

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.