From bd866271710b65d219be00f8ad1fbc3e3de47346 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Jun 2005 00:03:00 +0000 Subject: [PATCH] check for Unicode being used under Win9x much earlier on startup as otherwise the app crashes before getting to this check git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/app.cpp | 21 --------------------- src/msw/main.cpp | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 2c0de2d845..529d6688c0 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -280,27 +280,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) } #endif - // the first thing to do is to check if we're trying to run an 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 && wxGetOsVersion() != wxWINDOWS_CE && wxGetOsVersion() != wxWINDOWS_SMARTPHONE && wxGetOsVersion() != wxWINDOWS_POCKETPC ) - { - // note that we can use MessageBoxW() as it's implemented even under - // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs - // used by wxLocale are not - ::MessageBox - ( - NULL, - _T("This program uses Unicode and requires Windows NT/2000/XP/CE.\nProgram aborted."), - _T("wxWidgets Fatal Error"), - MB_ICONERROR | MB_OK - ); - - return false; - } -#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU - #if defined(__WIN95__) && !defined(__WXMICROWIN__) InitCommonControls(); #endif // __WIN95__ diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 75eb058746..577873e340 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -262,6 +262,28 @@ WXDLLEXPORT int wxEntry(HINSTANCE hInstance, wxCmdLineArgType WXUNUSED(pCmdLine), int nCmdShow) { + // the first thing to do is to check if we're trying to run an Unicode + // program under Win9x w/o MSLU emulation layer - if so, abort right now + // as it has no chance to work and has all chances to crash +#if wxUSE_UNICODE && !wxUSE_UNICODE_MSLU && !defined(__WXWINCE__) + if ( wxGetOsVersion() != wxWINDOWS_NT ) + { + // note that we can use MessageBoxW() as it's implemented even under + // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs + // used by wxLocale are not + ::MessageBox + ( + NULL, + _T("This program uses Unicode and requires Windows NT/2000/XP.\nProgram aborted."), + _T("wxWidgets Fatal Error"), + MB_ICONERROR | MB_OK + ); + + return -1; + } +#endif // wxUSE_UNICODE && !wxUSE_UNICODE_MSLU + + // remember the parameters Windows gave us wxSetInstance(hInstance); wxApp::m_nCmdShow = nCmdShow; -- 2.47.2