diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 12feee5bdf..9d35d67001 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -69,12 +69,25 @@ WXDLLEXPORT int wxEntry(HINSTANCE hInstance, // break the command line in words wxArrayString args; + const wxChar *cmdLine = ::GetCommandLine(); if ( cmdLine ) { args = wxCmdLineParser::ConvertStringToArgs(cmdLine); } +#ifdef __WXWINCE__ + // WinCE doesn't insert the program itself, so let's + // do it here. + wxString programName; + + if ( ::GetModuleFileName( (HMODULE) wxGetInstance(), wxStringBuffer(programName, MAX_PATH), MAX_PATH ) == 0) + { + wxLogLastError(_T("GetModuleFileName")); + } + args.Insert(programName, 0); +#endif + int argc = args.GetCount(); // +1 here for the terminating NULL