Package com.jacob.com

Examples of com.jacob.com.Dispatch


     * @throws ExpressionException
   */
  public COMObject(String dispatch) {
    //if(!SystemUtil.isWindows()) throw new ExpressionException("Com Objects are only supported in Windows Enviroments");
    this.name=dispatch;
    this.dispatch=new Dispatch(dispatch);
  }
View Full Code Here


     
      //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;
      }
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();
      }
View Full Code Here

                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();
View Full Code Here

TOP

Related Classes of com.jacob.com.Dispatch

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.