views:

12

answers:

0

I'm using JACOB to call VB function from dll file the function on VB :

VARIANT_BOOL GetGeneralLogDataStr([in] LONG dwMachineNumber, [out] LONG*
dwEnrollNumber, [out] LONG* dwVerifyMode, [out] LONG* dwInOutMode, [out] BSTR
*TimeStr);

I try to call it with java :

Dispatch dispatch = new Dispatch("zkemkeeper.ZKEM.1");
Long a = new Long(0), b= new Long(0), c= new Long(0);
String s = new String();
System.out.println(Dispatch.call(dispatch, "GetGeneralLogDataStr", 2, a, b, c, s);

but i got exception

java.lang.ClassCastException: cannot convert to Variant
        at com.jacob.com.Dispatch.obj2variant(Dispatch.java)
        at com.jacob.com.Dispatch.obj2variant(Dispatch.java)
        at com.jacob.com.Dispatch.call(Dispatch.java)