Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-swt-dev] OLE IDispatch subclass as invoke variant parameter

Hi Devs,
sorry to bother you, but it seems this is something nobody knows about.

I need to call an ActiveX method, passing a subclass of IDispatch as a parameter. Now, in java it would be something like :

       NeededClass c = new NeededClass(param1, param2);
       activex.method(a,b,c)

With invoke it is something like this :

       Variant okcmd = new Variant(command);
       Variant okparam = new Variant(param);
       auto.invoke(METHOD_ExecCommand, new Variant[] { okcmd, okparam});

But param should be something like :

param = new NeededClass();

Where NeededClass extends IDispatch. I've searched in SWT code, tryed to allocate global ram, create the class in java, call movememory and pass it by reference, but it should not be passed by reference (JVM simply crashes with EXCEPTION_ACCESS_VIOLATION). Maybe I should obtain an OleAutomation to the needed class, set properties on it, and then wrap it in a variant .... but basically i'm stuck on this.

Can anybody help?

Simone




Back to the top