[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [platform-swt-dev] Implementing IID_IDispatch from within Eclipse
|
Title: Message
I was
able to do this using the latest build of Eclipse. The details are
slightly different than the patch I suggested, but what's in place works
fine.
The
recipe is as follows:
COMObject thisIDisp = new COMObject( new int[]{2,0,0,1,3,5,8})
{
public int method0(int[] args) {/*QueryInterface:
details omitted*/);}
public int method1(int[] args)
{/*AddRef(): details omitted*/}
public int method2(int[]
args) {/*Release(): details omitted*/}
public int
method3(int[] args) {/*GetTypeInfoCount: details
omitted*/ }
public int method4(int[] args)
{/*GetTypeInfo: details omitted*/ }
public int
method5(int[] args) {/*GetIDsOfNames: details
omitted*/ }
public int method6(int[] args) {/*Invoke:
details omitted */}
};
IDispatch id = new
IDispatch( thisIDispatch.getAddress() );
Variant v = new Variand( id );
At
that point, you have a Variant that can be passed to the APIs of
IE.
Be
aware that you have to write code to crack the parameters to the IDispatch
methods. This is not a simple feat for methods like "Invoke". It
would be very convenient if this were better supported ... perhaps something
like a base class of IDispatchImpl.java as a peer to COMObject.java
?
Folks,
I
have exactly the same requirement as that requested by Lynn Monson (http://dev.eclipse.org/mhonarc/lists/platform-swt-dev/msg00479.html)
"I need
to install DHTML event handlers and 'behaviors' into elements of the IE DOM.
To do this, I need to generate, in Java, an implementation of
IID_IDispatch, stuff it into a Variant, and pass the variant into IE by way of
OleAutomation...."
Is there a
resolution of this request? Can you advise me how to
proceed?
Thank you,
Seymour Kellerman
IBM Research
1 Rogers Street
Cambridge
MA 02142
Seymour_Kellerman@xxxxxxxxxx
617
693-5412