diff options
Diffstat (limited to 'examples/example-winmain/main.cpp')
| -rw-r--r-- | examples/example-winmain/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/example-winmain/main.cpp b/examples/example-winmain/main.cpp new file mode 100644 index 000000000..8094e7fc4 --- /dev/null +++ b/examples/example-winmain/main.cpp @@ -0,0 +1,28 @@ +#include "../stacktrace-windows/common.h" + +#include <stdio.h> +#include <stdlib.h> +#include <windows.h> + +extern int exampleMain(int argc, char** argv); +extern const char* const g_logFileName; + +int WinMain( + HINSTANCE /* instance */, + HINSTANCE /* prevInstance */, + LPSTR /* commandLine */, + int /*showCommand*/) + +{ + FILE* logFile = fopen(g_logFileName, "w"); + __try + { + int argc = 0; + char** argv = nullptr; + return exampleMain(argc, argv); + } + __except (exceptionFilter(logFile, GetExceptionInformation())) + { + ::exit(1); + } +} |
