| 356 | } |
| 357 | |
| 358 | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) |
| 359 | { |
| 360 | UNREFERENCED_PARAMETER(hPrevInstance); |
| 361 | UNREFERENCED_PARAMETER(lpCmdLine); |
| 362 | |
| 363 | // Run the application |
| 364 | int result = Run(hInstance, lpCmdLine); |
| 365 | |
| 366 | // Check for memory leaks |
| 367 | #if defined _CRTDBG_MAP_ALLOC |
| 368 | _CrtDumpMemoryLeaks(); |
| 369 | #endif |
| 370 | |
| 371 | // If an error occurred, spawn a message box |
| 372 | if (result != EXIT_SUCCESS) |
| 373 | { |
| 374 | MessageBox(NULL, "An error occurred. See log.txt for details.", NULL, MB_OK); |
| 375 | } |
| 376 | |
| 377 | return result; |
| 378 | } |