]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxActiveXContainer::QueryClientSiteInterface to allow customisation of ActiveX...
authorSteve Lamerton <steve.lamerton@gmail.com>
Sun, 15 Jan 2012 19:05:34 +0000 (19:05 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Sun, 15 Jan 2012 19:05:34 +0000 (19:05 +0000)
Closes #13784.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/ole/activex.h
interface/wx/msw/ole/activex.h
src/msw/ole/activex.cpp

index f07c262c0516fef81df21749995ceb1c89731880..b350f87320678b338d4ec6e3437cd8f8d8bc2364 100644 (file)
@@ -169,6 +169,7 @@ public:
     void OnSetFocus(wxFocusEvent&);
     void OnKillFocus(wxFocusEvent&);
     virtual bool MSWTranslateMessage(WXMSG* pMsg);
     void OnSetFocus(wxFocusEvent&);
     void OnKillFocus(wxFocusEvent&);
     virtual bool MSWTranslateMessage(WXMSG* pMsg);
+    virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc);
 
 protected:
     friend class FrameSite;
 
 protected:
     friend class FrameSite;
index a8e9af8b3dbd6676ab10ca8d20c5345536e9347f..9f4bda5ff7e4c6e538e4bc231739e53bebf46077 100644 (file)
@@ -267,7 +267,7 @@ public:
     };
 
     wxIMPLEMENT_DYNAMIC_CLASS(wxPDFMediaBackend, wxMediaBackend);
     };
 
     wxIMPLEMENT_DYNAMIC_CLASS(wxPDFMediaBackend, wxMediaBackend);
-    
+
     // Put this in one of your existing source files and then create a wxMediaCtrl with
     wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, "myfile.pdf", wxID_ANY,
                                             wxDefaultPosition, wxSize(300,300),
     // Put this in one of your existing source files and then create a wxMediaCtrl with
     wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, "myfile.pdf", wxID_ANY,
                                             wxDefaultPosition, wxSize(300,300),
@@ -297,5 +297,18 @@ public:
             Interface of ActiveX control.
     */
     wxActiveXContainer(wxWindow* parent, REFIID iid, IUnknown* pUnk);
             Interface of ActiveX control.
     */
     wxActiveXContainer(wxWindow* parent, REFIID iid, IUnknown* pUnk);
+    /**
+        Queries host's site for interface.
+
+        @param iid
+            The iid of the required interface.
+        @param _interface
+            Double pointer to outgoing interface. Supply your own interface if desired.
+        @param desc
+            The description of the outgoing interface.
+        @return bool
+            Return true if interface supplied else return false.
+    */
+    virtual bool QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc);
 };
 
 };
 
index d161e6d4a61f8ab213ca4e6bc5750c3faadc606a..ce96506b59dd062c8b0cb9a8e4285f97acd2fccb 100644 (file)
@@ -633,6 +633,10 @@ public:
         return S_OK;
     }
 
         return S_OK;
     }
 
+    friend bool QueryClientSiteInterface(FrameSite *self, REFIID iid, void **_interface, const char *&desc)
+    {
+        return self->m_window->QueryClientSiteInterface(iid,_interface,desc);
+    }
 
 protected:
     wxActiveXContainer * m_window;
 
 protected:
     wxActiveXContainer * m_window;
@@ -670,6 +674,7 @@ DEFINE_OLE_TABLE(FrameSite)
     OLE_IINTERFACE(IOleDocumentSite)
     OLE_IINTERFACE(IAdviseSink)
     OLE_IINTERFACE(IOleControlSite)
     OLE_IINTERFACE(IOleDocumentSite)
     OLE_IINTERFACE(IAdviseSink)
     OLE_IINTERFACE(IOleControlSite)
+    OLE_INTERFACE_CUSTOM(QueryClientSiteInterface)
 END_OLE_TABLE
 
 
 END_OLE_TABLE
 
 
@@ -1276,4 +1281,17 @@ bool wxActiveXContainer::MSWTranslateMessage(WXMSG* pMsg)
     return wxWindow::MSWTranslateMessage(pMsg);
 }
 
     return wxWindow::MSWTranslateMessage(pMsg);
 }
 
+//---------------------------------------------------------------------------
+// wxActiveXContainer::QueryClientSiteInterface
+//
+// Called in the host's site's query method for other interfaces.
+//---------------------------------------------------------------------------
+bool wxActiveXContainer::QueryClientSiteInterface(REFIID iid, void **_interface, const char *&desc)
+{
+    wxUnusedVar(iid);
+    wxUnusedVar(_interface);
+    wxUnusedVar(desc);
+    return false;
+}
+
 #endif // wxUSE_ACTIVEX
 #endif // wxUSE_ACTIVEX