]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ole/automtn.cpp
- Rewrite wxHeaderCtrl to be virtual-like: even if we don't need an infinite
[wxWidgets.git] / src / msw / ole / automtn.cpp
index 3fb683fbcfab46eb130ad91ba2f9a59721f4f121..d10484a938e117c22f427a77e8aa34b3c68fcceb 100644 (file)
@@ -538,8 +538,13 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const
         return false;
     }
 
         return false;
     }
 
-    // start a new copy of Excel, grab the IDispatch interface
-    if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, 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;
     {
         wxLogWarning(wxT("Cannot start an instance of this class."));
         return false;