Bug 68194 - [OLE] OLE components w/o visual representation
Summary: [OLE] OLE components w/o visual representation
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows All
: P3 enhancement with 5 votes (vote)
Target Milestone: 3.6 M2   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 38352 75352 120792 (view as bug list)
Depends on:
Blocks: 256749
  Show dependency tree
 
Reported: 2004-06-22 12:34 EDT by Max Stepanov CLA
Modified: 2009-08-13 09:57 EDT (History)
11 users (show)

See Also:


Attachments
OleObjectSite.java (1.63 KB, text/plain)
2004-06-22 12:40 EDT, Max Stepanov CLA
no flags Details
Possible solution for this problem (3.05 KB, patch)
2006-11-30 18:05 EST, Ken Guy CLA
no flags Details | Diff
this file have the changes which we require to get a safearray of IDispatch interface from OLE. (37.01 KB, text/plain)
2009-08-07 07:04 EDT, padamev297 CLA
no flags Details
this file have the changes in OLEVariant.java file which we require to get a safearray of IDispatch interface from OLE. (27.22 KB, text/plain)
2009-08-07 07:09 EDT, padamev297 CLA
no flags Details
new patch (4.06 KB, patch)
2009-08-12 11:36 EDT, Felipe Heidrich CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Max Stepanov CLA 2004-06-22 12:34:54 EDT
Neither OleControlSite nor OleClientSite give capability to create simple OLE 
object that doesn't have visual representation.
Comment 1 Max Stepanov CLA 2004-06-22 12:40:44 EDT
Created attachment 12661 [details]
OleObjectSite.java

Attached file (OleObjectSite.java) successfully creates those OLE components.
Comment 2 Gary Gregory CLA 2004-10-05 17:38:35 EDT
I would be nice to have a COM Automation class that does not require UI stuff
like  the 'Composite parent, int style" in the example given. Perhaps this stuff
could be refactor to allow this?
Comment 3 Gary Gregory CLA 2004-10-05 17:47:35 EDT
What I really need is: new OleAutomation("SomeProgId")
Comment 4 Veronika Irvine CLA 2004-10-13 10:16:41 EDT
*** Bug 75352 has been marked as a duplicate of this bug. ***
Comment 5 Ken Guy CLA 2006-11-30 18:05:41 EST
Created attachment 54838 [details]
Possible solution for this problem

This is a patch to allow you to do OleAutomation(progID), so you don't have to have a composite attached to your com object.
Comment 6 Dave Dunkin CLA 2006-12-06 16:07:02 EST
Would it be possible to have Ken's patch merged in for 3.3? It works beautifully for me.
Comment 7 Ben CLA 2007-02-09 11:28:19 EST
Works great for me too. Would be great if it was in 3.3
Comment 8 Duong Nguyen CLA 2007-02-19 17:00:42 EST
Can someone provide me with a sample piece of code to test Ken's code to show that it works? What's a valid "ProgId" that I can specify on a default Windows install?

I tried "Msxml" as someone suggested but it doesn't appear to work.
Comment 9 Dave Dunkin CLA 2007-03-07 12:32:06 EST
This works for me:


OleAutomation auto = new OleAutomation("InternetExplorer.Application");

int[] ids = auto.getIDsOfNames(new String[] { "visible" });
auto.setProperty(ids[0], new Variant(true));

ids = auto.getIDsOfNames(new String[] { "navigate" });
auto.invoke(ids[0], new Variant[] { new Variant("http://www.eclipse.org") });
Comment 10 padamev297 CLA 2009-03-25 05:27:05 EDT
The patch works for me fine.
Just curious to know when this patch will be a part of a release for
org.eclipse.swt.ole.win32.OleAutomation.java.

My project is dependent on this fix, so please tel me in which release of 
org.eclipse.swt... i can aspect these changes. 
Comment 11 Felipe Heidrich CLA 2009-03-25 10:26:47 EDT
(In reply to comment #10)
> The patch works for me fine.
> Just curious to know when this patch will be a part of a release for
> org.eclipse.swt.ole.win32.OleAutomation.java.
> My project is dependent on this fix, so please tel me in which release of 
> org.eclipse.swt... i can aspect these changes. 

I was assigned all OLE problems just 2 days ago. Unfortunately, we are already past API freeze, so it will be very hard to get new APIs in for Eclipse 3.5.

Also, SWT is a toolkit to build UI, writting a java wrap for ole is not our business (see Bug 256749). Once any support is in we will have to support it for ever. I suspect that is the reason we never fixed this problem.

That said, I see several people are interested in this bug. I'll talk to my manager about it.
Comment 12 padamev297 CLA 2009-03-27 01:18:13 EDT
I have a dependancy on this fix and as per the response that i got from the developer I need to
wait untill this fix is released.
isn't there any other option that i can use.
If i ask user  to use this patch also , so that my project could work fine then what is the procedure to 
install a patch like this.
Comment 13 padamev297 CLA 2009-03-30 02:44:00 EDT
can someone guide me on how to make use of this kind of patch.
My project depends on this fix, so do I need to ask user to 
use this patch as a fix as well.

Comment 14 padamev297 CLA 2009-08-07 07:04:10 EDT
Created attachment 143762 [details]
this file have the changes which we require to get a safearray of IDispatch interface from OLE.
Comment 15 padamev297 CLA 2009-08-07 07:09:18 EDT
Created attachment 143763 [details]
this file have the changes in OLEVariant.java file  which we require to get a safearray of IDispatch interface from OLE.

I have attached two files.

variant.java
OLEAutomation.java

These files now have the changes that is require for the support of returning or passing a safearray of IDispatch interfaces.
Comment 16 Felipe Heidrich CLA 2009-08-07 12:21:46 EDT
see Bug 93652 for VT_ARRAY support in Variant.

The best fix for this problem still is one proposed by Ken Guy in 2006.
Comment 17 Felipe Heidrich CLA 2009-08-12 11:36:52 EDT
Created attachment 144248 [details]
new patch

This patch adds the same constructor suggest in comment #5 fixing some problems in the original fix:

1) calls OleInitialize() / OleUninitialize
2) Doesn't leak IUnknown
3) Doesn't leak ITypeInfo (see Bug 120192)
Comment 18 Felipe Heidrich CLA 2009-08-12 12:44:05 EDT
*** Bug 38352 has been marked as a duplicate of this bug. ***
Comment 19 Felipe Heidrich CLA 2009-08-12 13:47:27 EDT
Fixed in HEAD > 20090812

I slightly changed the patch to make sure OleUninitialize() gets called in all cases.
Comment 20 Felipe Heidrich CLA 2009-08-13 09:57:42 EDT
*** Bug 120792 has been marked as a duplicate of this bug. ***