Package com.jacob.com

Examples of com.jacob.com.EnumVariant


        + "from Win32_NtLogEvent "
        + "where Logfile = 'Application' and TimeGenerated > '20070915000000.000000-***'";
    Variant vCollection = wmiconnect
        .invoke("ExecQuery", new Variant(query));

    EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());

    String resultString = "";
    Dispatch item = null;

    while (enumVariant.hasMoreElements()) {
      resultString = "";
      item = enumVariant.nextElement().toDispatch();
      String categoryString = Dispatch.call(item, "CategoryString")
          .toString();
      String messageString = Dispatch.call(item, "Message").toString();
      String timeGenerated = Dispatch.call(item, "TimeGenerated")
          .toString();
View Full Code Here


    /**
     * @param wrapper
     */
    public COMKeyWrapperIterator(COMObject wrapper) {
        this.enumVariant=new EnumVariant(wrapper.getDispatch());
        this.wrapper=wrapper;
    }
View Full Code Here

    /**
     * @param wrapper
     */
    public COMValueWrapperIterator(COMObject wrapper) {
        this.enumVariant=new EnumVariant(wrapper.getDispatch());
        this.wrapper=wrapper;
    }
View Full Code Here

      Variant vCollection = axWMI.invoke("ExecQuery", new Variant(query));
     
      //Our result is a collection, so we need to work though the collection.
      // (it is odd, but there may be more than one battery... think about multiple
      //   UPS on the system).
      EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
      Dispatch item = null;
      while (enumVariant.hasMoreElements()) {
        item = enumVariant.nextElement().toDispatch(); // throws errors sometimes
        int status = Dispatch.call(item,"BatteryStatus").getInt();
        result = status;
      }
    }
    else { // linux
View Full Code Here

 
    int[] result = { 999, 999 };
    if (Settings.os.equals("windows")) {
     
      Variant vCollection = axWMI.invoke("ExecQuery", new Variant(query));
      EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
      Dispatch item = null;
      while (enumVariant.hasMoreElements()) {
        item = enumVariant.nextElement().toDispatch();
        result[0] = Dispatch.call(item,"EstimatedChargeRemaining").getInt();
        result[1] = Dispatch.call(item,"BatteryStatus").getInt();
      }
    }
    else { // linux
View Full Code Here

    //Execute the query
                Variant[] vs = {new Variant(query)};
    Variant vCollection = axWMI.invoke("ExecQuery", vs);
   
    //Our result is a collection, so we need to work though the.
    EnumVariant enumVariant = new EnumVariant(vCollection.toDispatch());
    Dispatch item = null;
    while (enumVariant.hasMoreElements()) {
      enumVariant.nextElement();
      //Dispatch.call returns a Variant which we can convert to a java form.
      String BytesReceivedPerSec = Dispatch.call(item,"BytesReceivedPerSec").toString();
      String BytesSentPerSec = Dispatch.call(item,"BytesSentPerSec").toString();
      String BytesTotalPerSec = Dispatch.call(item,"BytesTotalPerSec").toString();
      String Caption = Dispatch.call(item,"Caption").toString();
View Full Code Here

TOP

Related Classes of com.jacob.com.EnumVariant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.