Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2018-04-11 17:59:10 +0000
committerLars Vogel2018-04-15 15:27:39 +0000
commit66bbce07c55f39dcf5080ace1ab49e9e4c9f379c (patch)
tree73dcabab95b4adcc222dc6fb9735f71acc5069ae
parent6b33bb17109330b209f52e7df0067698f22b1cfc (diff)
downloadeclipse.platform.swt-66bbce07c55f39dcf5080ace1ab49e9e4c9f379c.tar.gz
eclipse.platform.swt-66bbce07c55f39dcf5080ace1ab49e9e4c9f379c.tar.xz
eclipse.platform.swt-66bbce07c55f39dcf5080ace1ab49e9e4c9f379c.zip
Bug 318942 - [OLE] new OleAutomation(progId) fails because of missing flagI20180415-2000
If an in-process COM server is not available, try to create a local server. (CoCreateInstance will check InprocServer32, LocalService in that order). This change allows OleAutomation to interact with MS Office applications, Internet Explorer etc. Change-Id: Iae1d8ccfc74a2d993407144b8077b4c7be6556d1 Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java
index 73b2c923a9..1f586c7550 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT OLE Win32/win32/org/eclipse/swt/ole/win32/OleAutomation.java
@@ -151,8 +151,7 @@ public OleAutomation(String progId) {
OS.OleUninitialize();
OLE.error(OLE.ERROR_INVALID_CLASSID);
}
- int flags = COM.CLSCTX_INPROC_SERVER;
- if (progId.startsWith("Excel")) flags |= COM.CLSCTX_LOCAL_SERVER; //$NON-NLS-1$
+ int flags = COM.CLSCTX_INPROC_SERVER | COM.CLSCTX_LOCAL_SERVER;
long /*int*/[] ppvObject = new long /*int*/[1];
int result = COM.CoCreateInstance(appClsid, 0, flags, COM.IIDIUnknown, ppvObject);
if (result != COM.S_OK) {

Back to the top