On crash, takes minidump, then show MessageBox, and exit app.

This commit is contained in:
William Moberg
2016-02-12 03:32:42 +01:00
parent a15e01596a
commit 215b1b1aa4
3 changed files with 132 additions and 4 deletions
+18 -4
View File
@@ -1,11 +1,25 @@
#include "Game.h"
#include "MiniDump.h"
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException);
int main(int argc, char* argv[])
{
Game game(argc, argv);
while (game.Running()) {
game.Tick();
}
::SetUnhandledExceptionFilter(CrashHandler);
Game game(argc, argv);
while (game.Running()) {
game.Tick();
}
return 0;
}
LONG WINAPI CrashHandler(EXCEPTION_POINTERS* pException)
{
//Take minidump. path should be bin/TacticalZ.dmp
//Then show MessageBox, and exit application.
Create_Dump(pException, 1, 1);
return EXCEPTION_EXECUTE_HANDLER;// EXCEPTION_CONTINUE_SEARCH
}