Menu

#9 Use of IEnumVARIANT

open
nobody
None
5
2006-04-06
2006-04-06
marcow68
No

Hello,
I'm new in java com. I need some help on collecting
collection of data from wmi dispatch. I can request the
wmi class, but I don't understand how to implement
IEnumVARIANT to get them. Thanks for your help.
Here is how I request wmi com object :
ReleaseManager rm = new ReleaseManager();
IDispatch wmiApp = new IDispatch(rm,
"WbemScripting.SWbemLocator");
Object[] argConnect = new Object[2];
argConnect[0] = new String("127.0.0.1");
argConnect[1] = new String("Root\\CIMv2");
IDispatch wmiServices =
(IDispatch)wmiApp.method("ConnectServer",argConnect);
Object[] arglist1 = new Object[1];
arglist1[0] = new String("Win32_BIOS");
IDispatch wmiInstances = (IDispatch)
wmiServices.method("InstancesOf", arglist1);

And now, how can I get the collection?
IEnumVARIANT resultsNum=
(IEnumVARIANT)wmiInstances.get("_newenum");?
I got the error :
java.lang.ClassCastException

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I am going to to look into it later this week.

     
  • marcow68

    marcow68 - 2006-07-07

    Logged In: YES
    user_id=1464085

    Any update? Thanks. Marc

     
  • marcow68

    marcow68 - 2006-08-07

    Logged In: YES
    user_id=1464085

    Were you able to have a look about my support request?
    Thanks a lot.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.