locked
How to handle any crash metro style app

    Question

  • If there are some issues creating the render device or any other core stuff I want to alert the player that a fatal error has happened and close the App/game.

    This App/game is written in c++ with DirectX11

    Now I'm using corewindow->Close() but this throws me an exception.

    There is no "legal" way to close an App and if there is a crash the app/game should restart.

    My issue is what to do in the case of any fatal error at start.

    Friday, June 15, 2012 7:29 PM

Answers

  • Hi Felipe,

    If there is an exception that you don't know how to handle then just let it bubble up and crash the app rather than trying to catch it. This should generate a report for you in the store developer portal.

    If you run into an unrecoverable failure from an initialization or other critical function then you can throw an exception wrapping it so you can get the report. Alternatively, if you're in a state where you can show a message to the user then you can do so. You don't need to provide a way to end the application: the user can close it with the standard mechanisms (drag from the top or F4).

    --Rob

    Monday, June 18, 2012 10:47 PM
    Owner

All replies

  • Hello,

     

    I think you can create the dump file to analyze this issue.

    When you break in the Visual Studio debugger because of the access denied exception, go to task manager, details tab.  Find your application e.g. application1.exe, right click on it, and select create dump file.  There will be a dialog that tells you where Windows saved the file e.g. c:\users\yourname\appdata\local\temp\applicationname.dmp

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, June 18, 2012 12:20 PM
    Moderator
  • Thanks for your answer but that is not what I'm asking about...

    I need to know how to handle critical errors?

    When trying to initialize the graphics device if there is an issue that do not allow to create it, I can't continue with the game, which should be the correct procedure to continue? It would be ok to show a message to the user and end the application?

    Thanks

    Monday, June 18, 2012 3:54 PM
  • Hi Felipe,

    If there is an exception that you don't know how to handle then just let it bubble up and crash the app rather than trying to catch it. This should generate a report for you in the store developer portal.

    If you run into an unrecoverable failure from an initialization or other critical function then you can throw an exception wrapping it so you can get the report. Alternatively, if you're in a state where you can show a message to the user then you can do so. You don't need to provide a way to end the application: the user can close it with the standard mechanisms (drag from the top or F4).

    --Rob

    Monday, June 18, 2012 10:47 PM
    Owner
  • Thanks for your help!
    Monday, June 18, 2012 11:13 PM