How to handle any crash metro style app
-
Freitag, 15. Juni 2012 19:29
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.
Alle Antworten
-
Montag, 18. Juni 2012 12:20Moderator
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
-
Montag, 18. Juni 2012 15:54
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
-
Montag, 18. Juni 2012 22:47Moderator
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
- Als Antwort markiert Felipe Reinaud Montag, 18. Juni 2012 23:13
-
Montag, 18. Juni 2012 23:13Thanks for your help!

