Community
Participate
Working Groups
Version 3.1.M2. Enable non-UI use of OleAutomation class. The only way to create an OleAutomation object is with the constructor OleAutomation(OleClientSite clientSite). I would like to use non-UI Ole objects like the XSLT processor in MSXML. I would like to be able to simply say: new OleAutomation("SomeProgId") Gary
If I try to create an OleAutomation object on the Msxml object which comes with Windows XP Sp1 I get: org.eclipse.swt.SWTException: Failed to create Ole Client. result = -2147467262 at org.eclipse.swt.ole.win32.OLE.error(OLE.java:302) at org.eclipse.swt.ole.win32.OleControlSite.<init>(OleControlSite.java:101) at com.seagullsw.appinterface.transforms.ms.OleAutomationAction.createOleControlSite(OleAutomationAction.java:30) at com.seagullsw.appinterface.transforms.ms.OleAutomationAction.test(OleAutomationAction.java:41) at com.seagullsw.appinterface.transforms.ms.OleAutomationAction.main(OleAutomationAction.java:26) Exception in thread "main" The test code is attached.
Created attachment 14913 [details] My OleAutomationAction example.
What also hurts is that I cannot subclass OleAutomation as it is a final class. The Javadocs does not explain why the class is final. I do not think it should be. If the constructor OleAutomation(IDispatch idispatch) was public and OleAutomation was non-final I could probably being to try to workaround the current UI-ness of my issues. This is only my second foray into the Eclipse API, so I might be missing something. Aside from the Eclipse rocks.
Hm, sorry to ramble on. From the looks of OleControlSite(Composite parent, int style, String progId), it calls COM.OleCreate(...). I think that for simple OLE Automation, the API to call it "CreateObject()". I thought of trying to hack something myself but now I'd like to call OleClientSite.getClassID(), but... it is protected :-(. So I'll wait now for a comment from somone before driving myself nuts ;-)
Are you asking to be able to create a non-UI ole object? If so, I think this is a duplicate of bug 68194.
Yes, I need a non-UI OLE object, or in this case, what is also called a COM Automation Object.
*** This bug has been marked as a duplicate of 68194 ***