]> git.saurik.com Git - wxWidgets.git/commitdiff
Program args fix for WinCE
authorJulian Smart <julian@anthemion.co.uk>
Sun, 26 Sep 2004 16:42:21 +0000 (16:42 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 26 Sep 2004 16:42:21 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/main.cpp

index 12feee5bdfa443b7e5d52abe9fb1e1dbe7ac2a12..9d35d670013bc58289bdaade16836ba9b150832a 100644 (file)
@@ -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