Stopping error pop box
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Stopping error pop box

  1. #1
    Join Date
    Sep 2010
    Posts
    2

    Stopping error pop box

    Hi all,
    Searched around but can't quite find an answer, and hope this is the right place to ask the question.

    Basically, we have coded up a dll, which is called by a 3rd party application. This was originally coded in Visual Studio 6. We recently had to migrate the code to being compiled under visual studio 2008.

    On the new version of the dll we had an error which caused a pop error box of the type 'An unhandled win32 Exception occured in ******'. We found the error and corrected it no problem, however, the error does not cause the pop-up when run from the Visual Studio 6 build and I was wondering if there is a compile time option on Visual Studio 2008 that we could use to prevent the the pop-up message.

    The dll & 3rd party application are run in a batch mode and the pop-up window causes everything to hang until someone actions the pop-up, which is not possible in batch operation.
    We would prefere any future error to be noted and corrected afterwards rather then impact on a batch run.

    Thanks for any help on this.

  2. #2
    Join Date
    Jun 2009
    Location
    oklahoma
    Posts
    199

    Re: Stopping error pop box

    try/catch?

    Thats just hiding the problem though.

  3. #3
    Join Date
    Sep 2010
    Posts
    2

    Re: Stopping error pop box

    Would happily hide the problem if it meant the pop-up box would not appear!

    We have corrected for the issue we found (try- catch didn't actually catch the issue), but this is more to do with stopping the error pop-up message in the future if something else unexpected happens (Pop-up doesn't happen in the Visual Studio 6 version).

    Really just wondering if anyone else had something similar and if there are any complie time options in VS2008 we could use.

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,632

    Re: Stopping error pop box

    No there's no compiler/linker switch available for this.
    If try/catch doesn't solve your issue you have a non C++ expection. Check out SEH http://msdn.microsoft.com/en-us/libr...57(VS.85).aspx
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

  5. #5
    Arjay's Avatar
    Arjay is online now Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: Stopping error pop box

    Your best best is to debug and fix the code issue. VC6 wasn't very compliant and VC2008 is more strict and is exposing a coding error.

  6. #6
    Join Date
    Apr 1999
    Posts
    27,423

    Re: Stopping error pop box

    Quote Originally Posted by NCIRL View Post
    We found the error and corrected it no problem, however, the error does not cause the pop-up when run from the Visual Studio 6 build
    First you say you fixed the error, then you say that "the error does not...". I thought you fixed the error?
    and I was wondering if there is a compile time option on Visual Studio 2008 that we could use to prevent the the pop-up message.
    Why not fix the error now? The time it could take you to look for band-aid solutions could have been spent in diagnosing the cause of the problem.
    The dll & 3rd party application are run in a batch mode and the pop-up window causes everything to hang until someone actions the pop-up, which is not possible in batch operation.
    A lot of people would not put trust in a program that has an error, regardless of when it happens. If the DLL was coded in C++, runtime errors could be the sign of other things internally wrong with the program that you have yet to identify.

    Also, what if you could cover up this dialog box? What if the error is a very serious one? You would never know, and whoever is running this batch file is risking something very serious going wrong.

    Fix the error. Or at the very least, identify what the error is, note it, and then see if it can be "left for later".

    Regards,

    Paul McKenzie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center