X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/da58c4e6a0b41ec68d7a9ab501762b7264268752..9106ea703ca324d591ce3cfebe6b36935063e1e9:/src/msw/ole/activex.cpp diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 19cb1feed8..92a5a1186b 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -36,16 +36,16 @@ #include "wx/msw/private.h" // for wxCopyRectToRECT // autointerfaces that we only use here -WX_DECLARE_AUTOOLE(wxAutoIOleInPlaceSite, IOleInPlaceSite) -WX_DECLARE_AUTOOLE(wxAutoIOleDocument, IOleDocument) -WX_DECLARE_AUTOOLE(wxAutoIPersistStreamInit, IPersistStreamInit) -WX_DECLARE_AUTOOLE(wxAutoIAdviseSink, IAdviseSink) -WX_DECLARE_AUTOOLE(wxAutoIProvideClassInfo, IProvideClassInfo) -WX_DECLARE_AUTOOLE(wxAutoITypeInfo, ITypeInfo) -WX_DECLARE_AUTOOLE(wxAutoIConnectionPoint, IConnectionPoint) -WX_DECLARE_AUTOOLE(wxAutoIConnectionPointContainer, IConnectionPointContainer) +typedef wxAutoOleInterface wxAutoIOleInPlaceSite; +typedef wxAutoOleInterface wxAutoIOleDocument; +typedef wxAutoOleInterface wxAutoIPersistStreamInit; +typedef wxAutoOleInterface wxAutoIAdviseSink; +typedef wxAutoOleInterface wxAutoIProvideClassInfo; +typedef wxAutoOleInterface wxAutoITypeInfo; +typedef wxAutoOleInterface wxAutoIConnectionPoint; +typedef wxAutoOleInterface wxAutoIConnectionPointContainer; -wxDEFINE_EVENT( wxEVT_ACTIVEX, wxActiveXEvent ) +wxDEFINE_EVENT( wxEVT_ACTIVEX, wxActiveXEvent ); // Ole class helpers (sort of MFC-like) from wxActiveX #define DECLARE_OLE_UNKNOWN(cls)\ @@ -904,10 +904,10 @@ wxActiveXContainer::~wxActiveXContainer() } // VZ: we might want to really report an error instead of just asserting here -#ifdef __WXDEBUG__ +#if wxDEBUG_LEVEL #define CHECK_HR(hr) \ - wxASSERT_MSG( SUCCEEDED(hr), \ - wxString::Format("HRESULT = %X", (unsigned)(hr)) ) + wxASSERT_LEVEL_2_MSG( SUCCEEDED(hr), \ + wxString::Format("HRESULT = %X", (unsigned)(hr)) ) #else #define CHECK_HR(hr) wxUnusedVar(hr) #endif @@ -1022,11 +1022,14 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk) cpContainer->FindConnectionPoint(ta->guid, cp.GetRef()); CHECK_HR(hret); - IDispatch* disp; - m_frameSite->QueryInterface(IID_IDispatch, (void**)&disp); - hret = cp->Advise(new wxActiveXEvents(this, ta->guid), - &adviseCookie); - CHECK_HR(hret); + if ( cp ) + { + IDispatch* disp; + m_frameSite->QueryInterface(IID_IDispatch, (void**)&disp); + hret = cp->Advise(new wxActiveXEvents(this, ta->guid), + &adviseCookie); + CHECK_HR(hret); + } } }