From 66d314c232df7298cf5c792804325943eec6501c Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 25 Feb 2021 21:41:51 +0100 Subject: [PATCH] Implement QueryInterface of wxWebViewEdge CInvokable --- src/msw/webview_edge.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/msw/webview_edge.cpp b/src/msw/webview_edge.cpp index 0a73de5d08..2aefc038b2 100644 --- a/src/msw/webview_edge.cpp +++ b/src/msw/webview_edge.cpp @@ -41,14 +41,15 @@ public: CInvokable() : m_nRefCount(0) {} virtual ~CInvokable() {} // IUnknown methods - HRESULT STDMETHODCALLTYPE QueryInterface(REFIID WXUNUSED(riid), void** ppvObj) override + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObj) override { - /** - * WebView2 Runtime apparently doesn't use this method, so it doesn't - * matter how we implement this. On the other hand, this method must be - * implemented to make this invokable type a concrete class instead of a - * abstract one. - */ + if (riid == __uuidof(baseT) || riid == IID_IUnknown) + { + *ppvObj = this; + AddRef(); + return S_OK; + } + *ppvObj = NULL; return E_NOINTERFACE; }