Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. avoiding error messageboxes

avoiding error messageboxes

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingperformancetutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    marco p
    wrote on last edited by
    #1

    Hi. I have a faulty app that I should restart whenever it crashes. I can easily see when it's dead, since it creates a named mutex that disappear with the app. My problem is that if the app crashes and shows a MessageBox as this example: The instruction at "0x004015b0" referenced memory at "0x00000000". The memory could not be "written". Click on OK to terminate the program Click on CANCEL to debug the program Is there any way to avoid this? I can't modify the darned app's source code. thanks in advance, bye M.

    C 1 Reply Last reply
    0
    • M marco p

      Hi. I have a faulty app that I should restart whenever it crashes. I can easily see when it's dead, since it creates a named mutex that disappear with the app. My problem is that if the app crashes and shows a MessageBox as this example: The instruction at "0x004015b0" referenced memory at "0x00000000". The memory could not be "written". Click on OK to terminate the program Click on CANCEL to debug the program Is there any way to avoid this? I can't modify the darned app's source code. thanks in advance, bye M.

      C Offline
      C Offline
      Chris Richardson
      wrote on last edited by
      #2

      Run the process like it's being debugged (i.e. call CreateProcess with DEBUG_PROCESS), then handle the exception event in your debugger loop, and restart the program. It's really pretty easy to do and I point you to a simple example: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/writing_the_debugger_s_main_loop.asp[^] Chris Richardson
      Terrain Software

      M 1 Reply Last reply
      0
      • C Chris Richardson

        Run the process like it's being debugged (i.e. call CreateProcess with DEBUG_PROCESS), then handle the exception event in your debugger loop, and restart the program. It's really pretty easy to do and I point you to a simple example: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/writing_the_debugger_s_main_loop.asp[^] Chris Richardson
        Terrain Software

        M Offline
        M Offline
        marco p
        wrote on last edited by
        #3

        Thank you very much indeed, your answer is perfect for our needs. marco

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups