]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1357475 ] WinCE : wxExecute does not execute programs
authorJulian Smart <julian@anthemion.co.uk>
Thu, 24 Nov 2005 16:45:05 +0000 (16:45 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 24 Nov 2005 16:45:05 +0000 (16:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/utilsexc.cpp

index c7fa039d3a279ee8c1d5fe309a83f69ca847d8bd..2247c389d2e433048a976d9c494a2f6f9bbabae6 100644 (file)
@@ -706,15 +706,37 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler)
 
     PROCESS_INFORMATION pi;
     DWORD dwFlags = CREATE_SUSPENDED;
+
 #ifndef __WXWINCE__
     dwFlags |= CREATE_DEFAULT_ERROR_MODE ;
+#else
+    wxString ModuleName;
+    wxString Arguments;
+    { int idx = command.Find( wxT(' ') );
+      if( idx >= 0 ) {
+          ModuleName = command.Left(idx);
+          Arguments = command.Mid(idx+1);
+      } else {
+          ModuleName = command;
+      }
+    }
 #endif
 
     bool ok = ::CreateProcess
                 (
+                    // WinCE requires appname to be non null 
+                    // Win32 allows for null
+#ifdef __WXWINCE__
+                 (wxChar *)
+                 ModuleName.c_str(),   // application name
+                 (wxChar *)
+                 Arguments.c_str(),   // arguments
+                 
+#else
                  NULL,              // application name (use only cmd line)
                  (wxChar *)
-                 command.c_str(),   // full command line
+                 command.c_str(),   // full command line                 
+#endif
                  NULL,              // security attributes: defaults for both
                  NULL,              //   the process and its main thread
                  redirect,          // inherit handles if we use pipes