CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Location
    Croatia - Zagreb
    Posts
    459

    Intercepting program crashes.

    Is it possible to somehow override that ugly crash window? You know the one which prompts you to send Microsoft details about the crash?

    I'm in situation where a have an application, lets call it masterManager. And masterManager manages it's many processes whom he creates, controls and close. But once in a while one of the little processes will crash and I would like for masterManager to detect it before anyone else, even end user. Even before windows display it's Application error dialog.

    Any ideas on how to design and execute this? Or where to find info on the subject.
    Last edited by Odiee; May 21st, 2009 at 05:29 AM. Reason: Spelling
    You just divided by zero, didn't you?

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Intercepting program crashes.

    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Intercepting program crashes.

    Well, those articles may look frightening for a starter. Actually there several aspects in the situation, so let's dissect them.

    1. "once in a while one of the little processes will crash"

    Crash typically means that some unhandled exception occurs that cannot be handled by application, so it finally gets caght by OS providing that unfavorable dialog you hate that much.

    To avoid this the application must set the top level exception handler with SetUnhandledExceptionFilter Function. Onece you install a new handler instead of the system one, you are responsible for handling, and therefore, you never see that system dialog unless you call it intentionally.

    Note: application must serve this interception itself, as no other application could handle "foreign" exceptions, disregarding it's master or slave.

    2. This looks easy in case your "little applications" are written by you. The process catches the exception and notifies the masterManager. But if they are not, the masterManager must "help" them do that (I mean, set exception handler), and this can be done by injection of some dll that provides the handler code as well for pre-processing crash report and communicating it to the master.

    3. So this is about "injection" and "communication", that are totally different stories so far...
    Last edited by Igor Vartanov; May 24th, 2009 at 06:11 AM.
    Best regards,
    Igor

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured