Bug 75352 - Enable non-UI use of OleAutomation class.
Summary: Enable non-UI use of OleAutomation class.
Status: RESOLVED DUPLICATE of bug 68194
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-29 16:58 EDT by Gary Gregory CLA
Modified: 2004-10-13 10:16 EDT (History)
0 users

See Also:


Attachments
My OleAutomationAction example. (1.72 KB, text/plain)
2004-09-29 17:05 EDT, Gary Gregory CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Gregory CLA 2004-09-29 16:58:34 EDT
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
Comment 1 Gary Gregory CLA 2004-09-29 17:05:18 EDT
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.

Comment 2 Gary Gregory CLA 2004-09-29 17:05:59 EDT
Created attachment 14913 [details]
My OleAutomationAction example.
Comment 3 Gary Gregory CLA 2004-09-29 17:14:35 EDT
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.
Comment 4 Gary Gregory CLA 2004-09-29 17:35:40 EDT
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 ;-)
Comment 5 Veronika Irvine CLA 2004-10-05 16:10:06 EDT
Are you asking to be able to create a non-UI ole object?

If so, I think this is a duplicate of bug 68194.
Comment 6 Gary Gregory CLA 2004-10-05 17:04:22 EDT
Yes, I need a non-UI OLE object, or in this case, what is also called a COM
Automation Object.
Comment 7 Veronika Irvine CLA 2004-10-13 10:16:40 EDT

*** This bug has been marked as a duplicate of 68194 ***