X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/31f6de22b0575e7feac83e7f99b5774a3490fc1a..0fe5e8fea017ecb73f8aaa8ceb745feb269b3f79:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 67e6a44eae..e77f69dd65 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -49,6 +49,7 @@ #endif #include "wx/cmdline.h" +#include "wx/filename.h" #include "wx/module.h" #include "wx/msw/private.h" @@ -192,9 +193,9 @@ END_EVENT_TABLE() bool wxApp::Initialize() { // the first thing to do is to check if we're trying to run an Unicode - // program under Win9x - if so, abort right now as it has no chance to - // work -#if wxUSE_UNICODE + // program under Win9x w/o MSLU emulation layer - if so, abort right now + // as it has no chance to work +#if wxUSE_UNICODE && !wxUSE_UNICODE_MSLU if ( wxGetOsVersion() != wxWINDOWS_NT ) { // note that we can use MessageBoxW() as it's implemented even under @@ -203,20 +204,14 @@ bool wxApp::Initialize() ::MessageBox ( NULL, - _T("This program uses Unicode and requires Windows NT/2000.\nProgram aborted."), + _T("This program uses Unicode and requires Windows NT/2000/XP.\nProgram aborted."), _T("wxWindows Fatal Error"), MB_ICONERROR | MB_OK ); return FALSE; } -#endif // wxUSE_UNICODE - - // Some people may wish to use this, but - // probably it shouldn't be here by default. -#ifdef __WXDEBUG__ - // wxRedirectIOToConsole(); -#endif +#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU wxBuffer = new wxChar[1500]; // FIXME @@ -251,9 +246,11 @@ bool wxApp::Initialize() ; #endif // Win16 +#if wxUSE_OLE // we need to initialize OLE library if ( FAILED(::OleInitialize(NULL)) ) wxLogError(_("Cannot initialize OLE")); +#endif #endif // wxUSE_OLE @@ -463,6 +460,7 @@ bool wxApp::UnregisterWindowClasses() { bool retval = TRUE; +#ifndef __WXMICROWIN__ // frame window class. if ( !UnregisterClass(wxFrameClassName, wxhInstance) ) { @@ -541,7 +539,8 @@ bool wxApp::UnregisterWindowClasses() retval = FALSE; } - +#endif + // __WXMICROWIN__ return retval; } @@ -564,6 +563,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 +783,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