Package com.jacob.activeX

Examples of com.jacob.activeX.ActiveXComponent.invoke()


          + Dispatch.get(a1, "Value"));
      System.out.println("Retrieved a2 from excel:"
          + Dispatch.get(a2, "Value"));
      Variant f = new Variant(false);
      Dispatch.call(workbook, "Close", f);
      axc.invoke("Quit", new Variant[] {});

    } catch (ComException cfe) {
      cfe.printStackTrace();
      fail("Failed to attach to " + excelApplicationProgramId + ": "
          + cfe.getMessage());
View Full Code Here


    } catch (Throwable re) {
      threadFailedWithException = re;
      re.printStackTrace();
    } finally {
      System.out.println("IETestThread: About to send Quit");
      ie.invoke("Quit", new Variant[] {});
      System.out.println("IETestThread: Did send Quit");
    }
    // this blows up when it tries to release a DispatchEvents object
    // I think this is because there is still one event we should get back
    // "OnQuit" that will came after we have released the thread pool
View Full Code Here

    } catch (Throwable re) {
      threadFailedWithException = re;
      re.printStackTrace();
    } finally {
      System.out.println("IETestActiveProxyThread: About to send Quit");
      ie.invoke("Quit", new Variant[] {});
      System.out.println("IETestActiveProxyThread: Did send Quit");
    }
    // this blows up when it tries to release a DispatchEvents object
    // I think this is because there is still one event we should get back
    // "OnQuit" that will came after we have released the thread pool
View Full Code Here

          Thread.sleep(1000);
        } catch (Exception e) {
          e.printStackTrace();
        }
        System.out.println("Before Quit");
        excel.invoke("Quit", new Variant[] {});
        try {
          Thread.sleep(1000);
        } catch (Exception e) {
          e.printStackTrace();
        }
View Full Code Here

  public void runMonitor() {

    ActiveXComponent wmi = null;
    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.
View Full Code Here

    // the WMI supports a query language.
    String query = "select CategoryString, Message, TimeGenerated, User, Type "
        + "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 = "";
View Full Code Here

          }
        }

        if (xl != null) {
          try {
            xl.invoke("Quit", new Variant[] {});
          } catch (Exception e) {
            e.printStackTrace();
          }

          try {
View Full Code Here

      Dispatch.call(oActiveX, "DoCmd", new Integer(1010)).getInt();
      System.out.println("User hit the ok button.");
    } catch (ComFailException e) {
      System.out.println("User hit the cancel button: " + e);
    } finally {
      oActiveX.invoke("Quit");
    }
    return;
  }

  /**
 
View Full Code Here

      Variant f = new Variant(false);
      Dispatch.call(workbook, "Close", f);
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      xl.invoke("Quit", new Variant[] {});
      ComThread.Release();
    }
  }

}
View Full Code Here

      System.out.println("oNameSpace=" + oNameSpace);

      recurseFolders(0, oNameSpace);

    } finally {
      axOutlook.invoke("Quit", new Variant[] {});
    }
  }

}
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.