Package com.jacob.com

Examples of com.jacob.com.Variant


      int i = 0;
      try {
        ComThread.InitMTA();
        for (i = 0; i < count; i++) {
          SafeArray a1 = new SafeArray(Variant.VariantVariant, 2);
          a1.setVariant(0, new Variant("foo"));
          a1.setVariant(1, new Variant("bar"));
          Variant v = new Variant(a1);
          SafeArray a2 = v.toSafeArray(true);
          if (a2 == null) {
            System.out.println("got null back from toSafeArray()");
          }
        }
        ComThread.Release();
View Full Code Here


    // System.runFinalizersOnExit(true);

    ActiveXComponent mf = new ActiveXComponent("MultiFace.Face");
    try {
      // I am now dealing with the default interface (IFace1)
      Dispatch.put(mf, "Face1Name", new Variant("Hello Face1"));
      System.out.println(Dispatch.get(mf, "Face1Name"));

      // get to IFace2 through the IID
      Dispatch f2 = mf
          .QueryInterface("{9BF24410-B2E0-11D4-A695-00104BFF3241}");
      // I am now dealing with IFace2
      Dispatch.put(f2, "Face2Nam", new Variant("Hello Face2"));
      System.out.println(Dispatch.get(f2, "Face2Nam"));

      // get to IFace3 through the IID
      Dispatch f3 = mf
          .QueryInterface("{9BF24411-B2E0-11D4-A695-00104BFF3241}");
      // I am now dealing with IFace3
      Dispatch.put(f3, "Face3Name", new Variant("Hello Face3"));
      System.out.println(Dispatch.get(f3, "Face3Name"));

    } catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

  public void open(File f) throws VisioException {
    try {
      ActiveXComponent documents = new ActiveXComponent(getProperty(
          "Documents").toDispatch());
      Variant[] args = new Variant[1];
      args[0] = new Variant(f.getPath());
      documents.invoke("Open", args);
    } catch (Exception e) {
      e.printStackTrace();
      throw new VisioException(e);
    }
View Full Code Here

      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);
      // call it twice to see the objects reused
      result = Dispatch.call(sControl, "Eval", scriptCommand);
      // call it 3 times to see the objects reused
      result = Dispatch.call(sControl, "Eval", scriptCommand);
      System.out.println("eval(" + scriptCommand + ") = " + result);
View Full Code Here

  public void export(File f) throws VisioException {
    try {
      ActiveXComponent document = new ActiveXComponent(getProperty(
          "ActivePage").toDispatch());
      Variant[] args = new Variant[1];
      args[0] = new Variant(f.getPath());
      document.invoke("Export", args);
    } catch (Exception e) {
      throw new VisioException(e);
    }
  }
View Full Code Here

   * @param b
   * @throws VisioException
   */
  public void setVisible(boolean b) throws VisioException {
    try {
      setProperty("Visible", new Variant(b));
    } catch (Exception e) {
      throw new VisioException(e);
    }
  }
View Full Code Here

        Thread.sleep(1000);
      } catch (InterruptedException ie) {
        // should we get this?
      }

      Variant result = Dispatch.call(sControl, "Eval",
          getSampleVPScriptForEval());
      System.out.println("eval(" + getSampleVPScriptForEval() + ") = "
          + result);
      System.out.println("setting quit");
      ScriptTest3.quit = true;
View Full Code Here

    if (sC == null) {
      String lang = "VBScript";
      sC = new ActiveXComponent("ScriptControl");
      Dispatch.put(sC, "Language", lang);
    }
    Variant v = Dispatch.call(sC, "Eval", in.getText());
    out.setText(v.toString());
  }
View Full Code Here

      de = new DispatchEvents(sC, te);
      if (de == null) {
        System.out
            .println("null returned when trying to create DispatchEvents");
      }
      Variant result;
      result = sC.invoke("Eval", getSampleVPScriptForEval());
      // call it twice to see the objects reused
      result = sC.invoke("Eval", getSampleVPScriptForEval());
      // call it 3 times to see the objects reused
      result = sC.invoke("Eval", getSampleVPScriptForEval());
View Full Code Here

        Thread.sleep(1000);
      } catch (InterruptedException ie) {
        // should we get this?
      }

      Variant result = sC.invoke("Eval", getSampleVPScriptForEval());
      System.out.println("eval(" + getSampleVPScriptForEval() + ") = "
          + result);
      System.out.println("setting quit");
      ScriptTest3ActiveX.quit = true;
    } catch (ComException e) {
View Full Code Here

TOP

Related Classes of com.jacob.com.Variant

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.