I instantiate a COM Object, then invoke a method.
ActiveXComponent comp = new ActiveXComponent("MyDll.MyClass");
String argument1 = "test1";
String argument2 = "test2";
Variant[] arguments = { new Variant(argument1), new Variant(argument2) };
comp.invoke("myMethod", arguments)
Assuming MyDll has a method called
myMethod(String s1, String s2)
it works fine.
Now, what if I have a Method
myMethod(String s1, ReturnDeletedModeEnum enum)
with an enum defined in MyDll?
I need to pass the enum to the method somehow, but I don't know how to access it.
I tried getting the Enum as ActiveXComponent,
new ActiveXComponent("MyDll.ReturnDeletedModeEnum");
which (not surprisingly) didn't work:
com.jacob.com.ComFailException: Can't get object clsid from progid
I tried finding some more documentation about Jacob, because there seem to be Enum-specific classes, but I haven't found any explanation on how to use them.