This content has been marked as final. Show 7 replies
Hi there's a bit of code that I used and worked fine in my case. To set a variable I'd recomend you to use "Dispatch.put" instead of "setProperty"
private static ActiveXComponent myComponent;
private static Dispatch myObject;
MyComponent = new ActiveXComponent("clsid:XXXXXXXX");
MyObject = MyComponent.getObject();
//For setting and requesting properties
Dispatch.put( myObject, "Property", new Variant( new Integer (1024)));
//Now I want to check the set parameter
Variant vResultmine = Dispatch.call( myObject, "Property");
//This line makes "IOvar" to be a read-write String variable (the OCX will be able to put data on it)
Variant IOvar = new Variant(new String(""), true); //false will is used by default, in this case variables can not be written
//Next we invoke the method. In this case the method needs 2 String parameters and puts the result on a third variable (IOvariable)
Variant vResult = Dispatch.call(myObject, "Method",
//Now I print the obtained value
By the way, for questions regarding JACOB you can also check JACOB's forums too: http://sourceforge.net/forum/forum.php?forum_id=375946
Hope this helps
Thanks a lot for the reply but i am still getting the same error as stated earlier Catastrophic failure????
Perhaps the parameter you are using is not correct at all (the rest of your code seems fine to me). Anyway you'd better check JACOB forum. You'll find much more help on this issue there.
ok Thnx a lot !!! :)
Following your advise I am using
Variant IOvar = new Variant(new String(""), true);
for getting results from EnumKey method of StdRegProv in WMI:
Variant ret = Dispatch.call(oReg, "EnumKey", HKEY_LOCAL_MACHINE, strKeyPath,IOvar );
out.println("EnumKey: HKEY_LOCAL_MACHINE\\"+strKeyPath+"="+var +"arrSubKeys="+IOvar.toString()+"<BR>");
The output is:
How to enumerate IOvar then?
How did you resolve this error?
Pls mail me�at ...Certainly not. Any answers should be posted here. That's what these forums are for. This is not a personal coding service. I am blocking your post partly for that reason and partly because you have publicly disclosed an email address, which is a very poor practice unless you like spam.