Examples of OleAutomation


Examples of org.eclipse.swt.ole.win32.OleAutomation

      sb.append("(did you forget to prefix the call with 'this.'?)");
      throw new HResultException(sb.toString());
    } finally {
      for (int i = 0; i < javaParams.length; i++) {
        if (javaParams[i] instanceof OleAutomation) {
          OleAutomation tmp = (OleAutomation) javaParams[i];
          tmp.dispose();
        }
      }
    }
    return SwtOleGlue.convertObjectToVariant(cl, ora, method.getReturnType(), result);
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

          + "'");
      }
      int functionId = ids[0];
      // prepare function and "call" property
      Variant functionVariant = window.getProperty(functionId);
      OleAutomation function = functionVariant.getAutomation();
      int callId = function.getIDsOfNames(new String[]{"call"})[0];
      // dispose function variant (we have automation) and fill information object
      functionVariant.dispose();
      functionInfo = new NativeFunctionInfo(function, callId);
      m_nativeFunctions.put(name, functionInfo);
    }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

   *          the array of arguments. vArgs[0] is the this parameter supplied to the function, which
   *          must be null if it is static.
   * @return the return value of the JavaScript function
   */
  protected Variant doInvokeOnWindow2(OleAutomation window, String name, Variant[] vArgs) {
    OleAutomation funcObj = null;
    Variant funcObjVar = null;
    try {
      // Get the function object and its 'call' method.
      //
      int[] ids = window.getIDsOfNames(new String[]{name});
      if (ids == null) {
        throw new RuntimeException("Could not find a native method with the signature '"
          + name
          + "'");
      }
      int functionId = ids[0];
      funcObjVar = window.getProperty(functionId);
      funcObj = funcObjVar.getAutomation();
      int callDispId = funcObj.getIDsOfNames(new String[]{"call"})[0];
      // Invoke it and return the result.
      //
      return funcObj.invoke(callDispId, vArgs);
    } finally {
      if (funcObjVar != null) {
        funcObjVar.dispose();
      }
      if (funcObj != null) {
        funcObj.dispose();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

      sb.append("(did you forget to prefix the call with 'this.'?)");
      throw new HResultException(sb.toString());
    } finally {
      for (int i = 0; i < javaParams.length; i++) {
        if (javaParams[i] instanceof OleAutomation) {
          OleAutomation tmp = (OleAutomation) javaParams[i];
          tmp.dispose();
        }
      }
    }

    // Convert it to a variant (if the return type is void, return
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

   * @param propName name of the property to get
   * @return the property value as an integer
   * @throws RuntimeException if the property does not exist
   */
  private static int getIntProperty(IDispatch frameWnd, String propName) {
    OleAutomation window = null;
    try {
      window = new OleAutomation(frameWnd);
      int[] dispID = window.getIDsOfNames(new String[] { propName });
      if (dispID == null) {
        throw new RuntimeException("No such property " + propName);
      }
      Variant value = null;
      try {
        value = window.getProperty(dispID[0]);
        return value.getInt();
      } finally {
        if (value != null) {
          value.dispose();
        }
      }
    } finally {
      if (window != null) {
        window.dispose();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

   * @param intValue the value to set
   * @throws RuntimeException if the property does not exist
   */
  private static void setIntProperty(IDispatch frameWnd, String propName,
      int intValue) {
    OleAutomation window = null;
    try {
      window = new OleAutomation(frameWnd);
      int[] dispID = window.getIDsOfNames(new String[] { propName });
      if (dispID == null) {
        throw new RuntimeException("No such property " + propName);
      }
      Variant value = null;
      try {
        value = new Variant(intValue);
        window.setProperty(dispID[0], value);
      } finally {
        if (value != null) {
          value.dispose();
        }
      }
    } finally {
      if (window != null) {
        window.dispose();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

   *          supplied to the function, which must be null if it is static.
   * @return the return value of the JavaScript function
   */
  protected static Variant doInvokeOnWindow(OleAutomation window, String name,
      Variant[] vArgs) {
    OleAutomation funcObj = null;
    Variant funcObjVar = null;
    try {

      // Get the function object and its 'call' method.
      //
      int[] ids = window.getIDsOfNames(new String[] {name});
      if (ids == null) {
        throw new RuntimeException(
            "Could not find a native method with the signature '" + name + "'");
      }
      int functionId = ids[0];
      funcObjVar = window.getProperty(functionId);
      funcObj = funcObjVar.getAutomation();
      int callDispId = funcObj.getIDsOfNames(new String[] {"call"})[0];

      // Invoke it and return the result.
      //
      return funcObj.invoke(callDispId, vArgs);

    } finally {
      if (funcObjVar != null) {
        funcObjVar.dispose();
      }

      if (funcObj != null) {
        funcObj.dispose();
      }
    }
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

   */
  public ModuleSpaceIE6(ModuleSpaceHost host, IDispatch scriptFrameWindow,
      String moduleName, Object key) {
    super(host, moduleName, key);

    window = new OleAutomation(scriptFrameWindow);
  }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

    }
    // see if the variant is a wrapper object
    if (variant.getType() != COM.VT_DISPATCH) {
      return false;
    }
    OleAutomation auto = null;
    Variant result = null;
    try {
      auto = new OleAutomation(variant.getDispatch());
      // see if it has a valueOf method
      int[] ids = auto.getIDsOfNames(new String[] {"valueOf"});
      if (ids == null) {
        return false;
      }
      result = auto.invoke(ids[0]);
      /*
       * If the return type of the valueOf method is string, we assume it is a
       * String wrapper object.
       */
      return result.getType() == COM.VT_BSTR;
    } finally {
      if (auto != null) {
        auto.dispose();
      }
      if (result != null) {
        result.dispose();
      }
    }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

    try {
      // Create an Automation object for access to extended capabilities
      oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
          "ShockwaveFlash.ShockwaveFlash");
      OleAutomation oleAutomation = new OleAutomation(oleControlSite);
      flashObject = new OleObject(oleAutomation);
      created = true;
      final OleMsgHook hook = new OleMsgHook(this);
      oleControlSite.addDisposeListener(new DisposeListener() {
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.