win32: Do not throw exceptions from WinMain

Nicolas Hake 2011-01-02 03:50:06 +01:00
parent 2f6aaa9133
commit 12f6255453
1 changed files with 6 additions and 1 deletions

View File

@ -89,7 +89,12 @@ int WINAPI WinMain (HINSTANCE hInst,
int argc = 0;
LPWSTR *wargv = CommandLineToArgvW(GetCommandLineW(), &argc);
if (!wargv)
throw std::runtime_error("Unable to split command line");
{
const char *error = "Internal error: Unable to split command line! Exiting.";
Log(error);
Application.MessageDialog(error);
return C4XRV_Failure;
}
argv.reserve(argc);
// Convert args to UTF-8