Package com.jacob.com

Examples of com.jacob.com.DispatchEvents


   * @param typeLibLocation
   */
  private void hookupListener(Dispatch axc, String programId,
      String typeLibLocation) {
    // Add a listener (doesn't matter what it is).
    DispatchEvents applicationEvents;
    if (typeLibLocation == null) {
      applicationEvents = new DispatchEvents(axc, new ExcelEvents(
          programId));
    } else {
      applicationEvents = new DispatchEvents(axc, new ExcelEvents(
          programId), programId, typeLibLocation);
    }
    if (applicationEvents == null) {
      System.out
          .println("No exception thrown but no dispatch returned for Excel events");
View Full Code Here


    // Grab The Component.
    ActiveXComponent axc = new ActiveXComponent(pid);
    try {
      // Add a listener (doesn't matter what it is).
      DispatchEvents de;
      if (typeLibLocation == null) {
        de = new DispatchEvents(axc, new WordEventTest());
      } else {
        de = new DispatchEvents(axc, new WordEventTest(), pid,
            typeLibLocation);
      }
      if (de == null) {
        fail("No exception thrown but no dispatch returned for Word events");
      } else {
View Full Code Here

      System.out.println("IETestThread: " + Dispatch.get(ie, "Path"));
      Dispatch.put(ie, "StatusText", new Variant("My Status Text"));

      System.out.println("IETestThread: About to hookup event listener");
      IEEvents ieE = new IEEvents();
      new DispatchEvents(ie, ieE, "InternetExplorer.Application.1");
      System.out.println("IETestThread: Did hookup event listener");
      // / why is this here? Was there some other code here in the past?
      Variant optional = new Variant();
      optional.putNoParam();
View Full Code Here

        // sCon can be called from another thread
        sCon = new DispatchProxy(sControl);

        Dispatch.put(sControl, "Language", lang);
        ScriptTestErrEvents te = new ScriptTestErrEvents();
        de = new DispatchEvents(sControl, te);
        return true;
      } catch (Exception e) {
        e.printStackTrace();
        return false;
      }
View Full Code Here

  public void runTest() {
    // deprecated
    // System.runFinalizersOnExit(true);
    Dispatch test = new ActiveXComponent("MathTest.Math");
    TestEvents te = new TestEvents();
    DispatchEvents de = new DispatchEvents(test, te);
    if (de == null) {
      System.out
          .println("null returned when trying to create DispatchEvents");
    }
    System.out.println(Dispatch.call(test, "Add", new Variant(1),
View Full Code Here

   * creates a DispatchEvents object to register o as a listener
   *
   * @param o
   */
  public void addEventListener(VisioEventListener o) {
    DispatchEvents events = new DispatchEvents(this, o);
    if (events == null) {
      System.out
          .println("You should never get null back when creating a DispatchEvents object");
    }
  }
View Full Code Here

    }
  }

  public void testCreatingDispatchEvents() {
    ComThread.InitSTA(true);
    DispatchEvents de = null;
    Dispatch sControl = null;

    try {
      String scriptCommand = getSampleVPScriptForEval();
      String lang = "VBScript";
      ActiveXComponent sC = new ActiveXComponent("ScriptControl");
      sControl = sC.getObject();
      Dispatch.put(sControl, "Language", lang);
      ScriptTestErrEvents te = new ScriptTestErrEvents();
      de = new DispatchEvents(sControl, te);
      if (de == null) {
        System.out
            .println("Received null when trying to create new DispatchEvents");
      }
      Variant result = Dispatch.call(sControl, "Eval", scriptCommand);
View Full Code Here

        String lang = "VBScript";
        sC = new ActiveXComponent("ScriptControl");
        sControl = sC.getObject();
        Dispatch.put(sControl, "Language", lang);
        ScriptTestErrEvents te = new ScriptTestErrEvents();
        de = new DispatchEvents(sControl, te);
        System.out.println("sControl=" + sControl);
        while (!quit) {
          sleep(100);
        }
        ComThread.Release();
View Full Code Here

* options.
*/
public class ScriptTestActiveX extends BaseTestCase {
  public void testActiveXScript() {
    ComThread.InitSTA(true);
    DispatchEvents de = null;

    try {
      String lang = "VBScript";
      ActiveXComponent sC = new ActiveXComponent("ScriptControl");
      sC.setProperty("Language", lang);
      ScriptTestErrEvents te = new ScriptTestErrEvents();
      de = new DispatchEvents(sC, te);
      if (de == null) {
        System.out
            .println("null returned when trying to create DispatchEvents");
      }
      Variant result;
View Full Code Here

        System.out.println("OnInit");
        String lang = "VBScript";
        sC = new ActiveXComponent("ScriptControl");
        sC.setProperty("Language", lang);
        ScriptTestErrEvents te = new ScriptTestErrEvents();
        de = new DispatchEvents(sC, te);
        System.out.println("sControl=" + sC);
        while (!quit) {
          sleep(100);
        }
        ComThread.Release();
View Full Code Here

TOP

Related Classes of com.jacob.com.DispatchEvents

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.