Examples of DISPPARAMS


Examples of com.sun.jna.platform.win32.OleAuto.DISPPARAMS

            throw new COMException("pDisp (IDispatch) parameter is null!");

        // variable declaration
        int _argsLen = 0;
        VARIANT[] _args = null;
        DISPPARAMS dp = new DISPPARAMS();
        EXCEPINFO.ByReference pExcepInfo = new EXCEPINFO.ByReference();
        IntByReference puArgErr = new IntByReference();

        // make parameter reverse ordering as expected by COM runtime
        if ((pArgs != null) && (pArgs.length > 0)) {
            _argsLen = pArgs.length;
            _args = new VARIANT[_argsLen];

            int revCount = _argsLen;
            for (int i = 0; i < _argsLen; i++) {
                _args[i] = pArgs[--revCount];
            }
        }

        // Handle special-case for property-puts!
        if (nType == OleAuto.DISPATCH_PROPERTYPUT) {
            dp.cNamedArgs = new UINT(_argsLen);
            dp.rgdispidNamedArgs = new DISPIDByReference(
                    OaIdl.DISPID_PROPERTYPUT);
        }

        // Build DISPPARAMS
        if (_argsLen > 0) {
            dp.cArgs = new UINT(_args.length);
            // make pointer of variant array
            dp.rgvarg = new VariantArg.ByReference(_args);

            // write 'DISPPARAMS' structure to memory
            dp.write();
        }

        // Make the call!
        HRESULT hr = pDisp.Invoke(dispId, Guid.IID_NULL, LOCALE_SYSTEM_DEFAULT,
                new DISPID(nType), dp, pvResult, pExcepInfo, puArgErr);
View Full Code Here

Examples of com.sun.jna.platform.win32.OleAuto.DISPPARAMS

            throw new COMException("pDisp (IDispatch) parameter is null!");

        // variable declaration
        int _argsLen = 0;
        VARIANT[] _args = null;
        DISPPARAMS dp = new DISPPARAMS();
        EXCEPINFO.ByReference pExcepInfo = new EXCEPINFO.ByReference();
        IntByReference puArgErr = new IntByReference();

        // make parameter reverse ordering as expected by COM runtime
        if ((pArgs != null) && (pArgs.length > 0)) {
            _argsLen = pArgs.length;
            _args = new VARIANT[_argsLen];

            int revCount = _argsLen;
            for (int i = 0; i < _argsLen; i++) {
                _args[i] = pArgs[--revCount];
            }
        }

        // Handle special-case for property-puts!
        if (nType == OleAuto.DISPATCH_PROPERTYPUT) {
            dp.cNamedArgs = new UINT(_argsLen);
            dp.rgdispidNamedArgs = new DISPIDByReference(
                    OaIdl.DISPID_PROPERTYPUT);
        }

        // Build DISPPARAMS
        if (_argsLen > 0) {
            dp.cArgs = new UINT(_args.length);
            // make pointer of variant array
            dp.rgvarg = new VariantArg.ByReference(_args);

            // write 'DISPPARAMS' structure to memory
            dp.write();
        }

        // Make the call!
        HRESULT hr = pDisp.Invoke(dispId, Guid.IID_NULL, LOCALE_SYSTEM_DEFAULT,
                new DISPID(nType), dp, pvResult, pExcepInfo, puArgErr);
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

   */
  protected abstract Variant invoke(int dispId, int flags, Variant[] params)
      throws HResultException, InstantiationException, InvocationTargetException;

  private Variant[] extractVariantArrayFromDispParamsPtr(int pDispParams) {
    DISPPARAMS dispParams = new DISPPARAMS();
    COM.MoveMemory(dispParams, pDispParams, DISPPARAMS.sizeof);
    Variant[] variants = new Variant[dispParams.cArgs];
    // Reverse the order as we pull the variants in.
    for (int i = 0, n = dispParams.cArgs; i < n; ++i) {
      int varArgAddr = dispParams.rgvarg + Variant.sizeof * i;
 
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

    IDispatch objIDispatch = (IDispatch) ReflectionUtils.getFieldObject(automation, "objIDispatch");
    // get the IDispatch interface for the control
    if (objIDispatch == null)
      return COM.E_FAIL;
    // create a DISPPARAMS structure for the input parameters
    DISPPARAMS pDispParams = new DISPPARAMS();
    // store arguments in rgvarg
    if (rgvarg != null && rgvarg.length > 0) {
      pDispParams.cArgs = rgvarg.length;
      pDispParams.rgvarg =
          OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, VARIANT.sizeof * rgvarg.length);
 
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

          dispatch.Invoke(
            dispId,
            new GUID(),
            COM.LOCALE_USER_DEFAULT,
            COM.DISPATCH_METHOD,
            new DISPPARAMS(),
            pVarResultAddress,
            new EXCEPINFO(),
            pArgErr);
      if (hr >= COM.S_OK) {
        return Utils.win32_new(pVarResultAddress);
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

   */
  protected abstract Variant invoke(int dispId, int flags, Variant[] params)
      throws HResultException, InvocationTargetException;

  private Variant[] extractVariantArrayFromDispParamsPtr(int pDispParams) {
    DISPPARAMS dispParams = new DISPPARAMS();
    COM.MoveMemory(dispParams, pDispParams, DISPPARAMS.sizeof);
    Variant[] variants = new Variant[dispParams.cArgs];
    // Reverse the order as we pull the variants in.
    for (int i = 0, n = dispParams.cArgs; i < n; ++i) {
      int varArgAddr = dispParams.rgvarg + Variant.sizeof * i;
 
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

      pVarResultAddress = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT,
          Variant.sizeof);
      int[] pArgErr = new int[1];
      int hr = dispatch.Invoke(IDispatchProxy.DISPID_MAGIC_GETGLOBALREF,
          new GUID(), COM.LOCALE_USER_DEFAULT, COM.DISPATCH_METHOD,
          new DISPPARAMS(), pVarResultAddress, new EXCEPINFO(), pArgErr);

      if (hr >= COM.S_OK) {
        result = Variant.win32_new(pVarResultAddress);
        globalRef = result.getInt();
      }
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

  protected abstract Variant invoke(int dispId, int flags, Variant[] params)
      throws HResultException, InstantiationException,
      InvocationTargetException;

  private Variant[] extractVariantArrayFromDispParamsPtr(int pDispParams) {
    DISPPARAMS dispParams = new DISPPARAMS();
    COM.MoveMemory(dispParams, pDispParams, DISPPARAMS.sizeof);
    Variant[] variants = new Variant[dispParams.cArgs];
    // Reverse the order as we pull the variants in.
    for (int i = 0, n = dispParams.cArgs; i < n; ++i) {
      int varArgAddr = dispParams.rgvarg + Variant.sizeof * i;
 
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

    try {
      pVarResultAddress = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT,
          Variant.sizeof);
      int[] pArgErr = new int[1];
      int hr = dispatch.Invoke(dispId, new GUID(), COM.LOCALE_USER_DEFAULT,
          COM.DISPATCH_METHOD, new DISPPARAMS(), pVarResultAddress,
          new EXCEPINFO(), pArgErr);

      if (hr >= COM.S_OK) {
        return Variant.win32_new(pVarResultAddress);
      }
View Full Code Here

Examples of org.eclipse.swt.internal.ole.win32.DISPPARAMS

    try {
      pVarResultAddress = OS.GlobalAlloc(OS.GMEM_FIXED | OS.GMEM_ZEROINIT,
          Variant.sizeof);
      int[] pArgErr = new int[1];
      int hr = dispatch.Invoke(dispId, new GUID(), COM.LOCALE_USER_DEFAULT,
          COM.DISPATCH_METHOD, new DISPPARAMS(), pVarResultAddress,
          new EXCEPINFO(), pArgErr);

      if (hr >= COM.S_OK) {
        return Utils.win32_new(pVarResultAddress);
      }
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.