]> git.saurik.com Git - wxWidgets.git/commitdiff
using CLSCTX_ALL fails with Microsoft Office applications, correct the last change...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 26 Sep 2008 15:18:16 +0000 (15:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 26 Sep 2008 15:18:16 +0000 (15:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55899 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/ole/automtn.cpp

index b99c9c8d92a8bc3efd2b3386305bf457e938c774..d10484a938e117c22f427a77e8aa34b3c68fcceb 100644 (file)
@@ -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;