From 06936905a43d7a4b05bd3cc6eb50eb6ab24d0eeb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 26 Sep 2008 15:18:16 +0000 Subject: [PATCH] using CLSCTX_ALL fails with Microsoft Office applications, correct the last change to use CLSCTX_SERVER only (see #9868) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/ole/automtn.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index b99c9c8d92..d10484a938 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -538,8 +538,13 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const return false; } - // start a new copy of Excel, grab the IDispatch interface - if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_ALL, IID_IDispatch, (void**)&m_dispatchPtr))) + // get the server IDispatch interface + // + // NB: using CLSCTX_INPROC_HANDLER results in failure when getting + // Automation interface for Microsoft Office applications so don't use + // CLSCTX_ALL which includes it + if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_SERVER, IID_IDispatch, + (void**)&m_dispatchPtr))) { wxLogWarning(wxT("Cannot start an instance of this class.")); return false; -- 2.45.2