]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/activex.cpp
Keep the button bitmap centered if the button has no label in wxMSW.
[wxWidgets.git] / src / msw / ole / activex.cpp
index 73b51d3cacd64958b4ffb6efda45def9fe652718..92a5a1186b892bcacaa3dcaa67c81f5a6de38a74 100644 (file)
 #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<IOleInPlaceSite> wxAutoIOleInPlaceSite;
+typedef wxAutoOleInterface<IOleDocument> wxAutoIOleDocument;
+typedef wxAutoOleInterface<IPersistStreamInit> wxAutoIPersistStreamInit;
+typedef wxAutoOleInterface<IAdviseSink> wxAutoIAdviseSink;
+typedef wxAutoOleInterface<IProvideClassInfo> wxAutoIProvideClassInfo;
+typedef wxAutoOleInterface<ITypeInfo> wxAutoITypeInfo;
+typedef wxAutoOleInterface<IConnectionPoint> wxAutoIConnectionPoint;
+typedef wxAutoOleInterface<IConnectionPointContainer> wxAutoIConnectionPointContainer;
 
 wxDEFINE_EVENT( wxEVT_ACTIVEX, wxActiveXEvent );
 
@@ -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);
+                }
             }
         }