]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
Watcom compilation fix
[wxWidgets.git] / src / msw / app.cpp
index 67e6a44eae81920f6a5a978bb007ad2aa424c18a..c59675e7f6c7a2d8e9d301ca0187e11fa764b646 100644 (file)
@@ -49,6 +49,7 @@
 #endif
 
 #include "wx/cmdline.h"
+#include "wx/filename.h"
 #include "wx/module.h"
 
 #include "wx/msw/private.h"
@@ -463,6 +464,7 @@ bool wxApp::UnregisterWindowClasses()
 {
     bool retval = TRUE;
 
+#ifndef __WXMICROWIN__
     // frame window class.
     if ( !UnregisterClass(wxFrameClassName, wxhInstance) )
     {
@@ -541,7 +543,8 @@ bool wxApp::UnregisterWindowClasses()
 
         retval = FALSE;
     }
-
+#endif
+    // __WXMICROWIN__
     return retval;
 }
 
@@ -564,6 +567,13 @@ void wxApp::ConvertToStandardCommandArgs(const char* lpCmdLine)
     argv[0] = new wxChar[260]; // 260 is MAX_PATH value from windef.h
     ::GetModuleFileName(wxhInstance, argv[0], 260);
 
+    // also set the app name from argv[0]
+    wxString name;
+    wxFileName::SplitPath(argv[0], NULL, &name, NULL);
+
+    SetAppName(name);
+
+    // copy all the other arguments to wxApp::argv[]
     for ( int i = 1; i < argc; i++ )
     {
         argv[i] = copystring(args[i - 1]);
@@ -777,7 +787,8 @@ int wxEntry(WXHINSTANCE hInstance,
         wxCHECK_MSG( wxTheApp, 0, wxT("You have to define an instance of wxApp!") );
 
         // save the WinMain() parameters
-        wxTheApp->ConvertToStandardCommandArgs(lpCmdLine);
+        if (lpCmdLine) // MicroWindows passes NULL
+            wxTheApp->ConvertToStandardCommandArgs(lpCmdLine);
         wxTheApp->m_nCmdShow = nCmdShow;
 
         // We really don't want timestamps by default, because it means