X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..6ee3c06421446908fabe9de45b8e0c7519c28c24:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 8a3a74a420..26e39644e4 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -111,7 +111,8 @@ #if _WIN32_IE >= 0x0300 && \ (!defined(__MINGW32__) || wxCHECK_W32API_VERSION( 2, 0 )) && \ - !defined(__CYGWIN__) && !defined(__WXWINCE__) + !defined(__CYGWIN__) && !defined(__WXWINCE__) && \ + (!defined(_MSC_VER) || (_MSC_VER > 1100)) #include #endif @@ -270,7 +271,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // 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 ) + if ( wxGetOsVersion() != wxWINDOWS_NT && wxGetOsVersion() != wxWINDOWS_CE ) { // note that we can use MessageBoxW() as it's implemented even under // Win9x - OTOH, we can't use wxGetTranslation() because the file APIs @@ -278,7 +279,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) ::MessageBox ( NULL, - _T("This program uses Unicode and requires Windows NT/2000/XP.\nProgram aborted."), + _T("This program uses Unicode and requires Windows NT/2000/XP/CE.\nProgram aborted."), _T("wxWindows Fatal Error"), MB_ICONERROR | MB_OK ); @@ -302,9 +303,14 @@ bool wxApp::Initialize(int& argc, wxChar **argv) #if wxUSE_OLE // we need to initialize OLE library +#ifdef __WXWINCE__ + if ( FAILED(::CoInitializeEx(NULL, COINIT_MULTITHREADED)) ) + wxLogError(_("Cannot initialize OLE")); +#else if ( FAILED(::OleInitialize(NULL)) ) wxLogError(_("Cannot initialize OLE")); #endif +#endif #endif // wxUSE_OLE @@ -510,7 +516,11 @@ void wxApp::CleanUp() ::DeleteObject( wxDisableButtonBrush ); #if wxUSE_OLE +#ifdef __WXWINCE__ + ::CoUninitialize(); +#else ::OleUninitialize(); +#endif #endif // for an EXE the classes are unregistered when it terminates but DLL may @@ -793,23 +803,8 @@ void wxApp::OnIdle(wxIdleEvent& event) return; wxIsInOnIdleFlag = TRUE; - - // If there are pending events, we must process them: pending events - // are either events to the threads other than main or events posted - // with wxPostEvent() functions - // GRG: I have moved this here so that all pending events are processed - // before starting to delete any objects. This behaves better (in - // particular, wrt wxPostEvent) and is coherent with wxGTK's current - // behaviour. Changed Feb/2000 before 2.1.14 - ProcessPendingEvents(); - - // 'Garbage' collection of windows deleted with Close(). - DeletePendingObjects(); - -#if wxUSE_LOG - // flush the logged messages if any - wxLog::FlushActive(); -#endif // wxUSE_LOG + + wxAppBase::OnIdle(event); #if wxUSE_DC_CACHEING // automated DC cache management: clear the cached DCs and bitmap @@ -819,14 +814,6 @@ void wxApp::OnIdle(wxIdleEvent& event) wxDC::ClearCache(); #endif // wxUSE_DC_CACHEING - // Send OnIdle events to all windows - if ( SendIdleEvents() ) - { - // SendIdleEvents() returns TRUE if at least one window requested more - // idle events - event.RequestMore(TRUE); - } - wxIsInOnIdleFlag = FALSE; }