extracted code calling {Ole|Co}[Un]Initialize() to wxOle[Un]Initialize() functions in oleutils.h

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-03-11 11:47:13 +00:00
parent 61ad154c01
commit 360ae33f43
2 changed files with 48 additions and 21 deletions

View File

@@ -54,6 +54,7 @@
#include "wx/dynlib.h"
#include "wx/msw/private.h"
#include "wx/msw/ole/oleutils.h"
#if wxUSE_TOOLTIPS
#include "wx/tooltip.h"
@@ -299,20 +300,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
InitCommonControls();
#endif // __WIN95__
#if wxUSE_OLE || wxUSE_DRAG_AND_DROP
#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
wxOleInitialize();
RegisterWindowClasses();
@@ -489,13 +477,7 @@ void wxApp::CleanUp()
wxCleanUpPenWin();
#endif
#if wxUSE_OLE
#ifdef __WXWINCE__
::CoUninitialize();
#else
::OleUninitialize();
#endif
#endif
wxOleUninitialize();
// for an EXE the classes are unregistered when it terminates but DLL may
// be loaded several times (load/unload/load) into the same process in