Examples of toDispatch()


Examples of com.jacob.com.Variant.toDispatch()

      //System.out.println("Sheetcount = "+sheetCount);
      StringBuffer contentBuf = new StringBuffer(DEFAULT_BUFFER_SIZE);
      for (int sheetIdx = 1; sheetIdx <= sheetCount; sheetIdx++) {
        Variant sheetVariant = (Variant) sheets.getItem(new Variant(sheetIdx));
        Worksheet sheet = new Worksheet(sheetVariant.toDispatch());
        Variant after = new Variant(sheet.getRange(new Variant("IV65536")));
        Range extractRange;
        // Find the top left and bottom right corner enclosing the data in the sheet
        try {
          // The following calls may fail because the find operation returns
View Full Code Here

Examples of com.jacob.com.Variant.toDispatch()

    wmi = new ActiveXComponent("WbemScripting.SWbemLocator");
    // no connection parameters means to connect to the local machine
    Variant conRet = wmi.invoke("ConnectServer");
    // the author liked the ActiveXComponent api style over the Dispatch
    // style
    ActiveXComponent wmiconnect = new ActiveXComponent(conRet.toDispatch());

    // the WMI supports a query language.
    String query = "select CategoryString, Message, TimeGenerated, User, Type "
        + "from Win32_NtLogEvent "
        + "where Logfile = 'Application' and TimeGenerated > '20070915000000.000000-***'";
 
View Full Code Here

Examples of com.jacob.com.Variant.toDispatch()

        + "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()) {
View Full Code Here

Examples of com.jacob.com.Variant.toDispatch()

      // put the variant in the array
      sa.setVariant(0, v);

      // take it back out
      Variant v2 = sa.getVariant(0);
      Dispatch d = v2.toDispatch();

      // make sure you can call eval on it
      result = Dispatch.call(d, "Eval", scriptCommand);
      assertTrue(result.toString().equals("6"));
    } catch (ComException e) {
View Full Code Here

Examples of com.jacob.com.Variant.toDispatch()

    // this should return false
    System.out.println("v.isNull=" + v.isNull());
    v = Dispatch.call(test, "getNothing");
    // these should return nothing
    System.out.println("v.isNull=" + v.isNull());
    System.out.println("v.toDispatch=" + v.toDispatch());
  }

  /**
   *
   * sample class to catch the events
View Full Code Here

Examples of com.jacob.com.Variant.toDispatch()

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

Examples of com.jacob.com.Variant.toDispatch()

 
    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

Examples of com.jacob.com.Variant.toDispatch()

    //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();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.