Package org.eclipse.swt.internal.ole.win32

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


          try {
            if (params.length < 3) {
              reportIncorrectInvocation("gwtOnLoad", 3, params.length);
              throw new HResultException(COM.E_INVALIDARG);
            }
            IDispatch frameWnd = (params[0].getType() == COM.VT_DISPATCH)
                ? params[0].getDispatch() : null;
            String moduleName = (params[1].getType() == COM.VT_BSTR)
                ? params[1].getString() : null;
            String version = (params[2].getType() == COM.VT_BSTR)
                ? params[2].getString() : null;
            boolean success = gwtOnLoad(frameWnd, moduleName, version);

            // boolean return type
            return new Variant(success);
          } catch (SWTException e) {
            throw new HResultException(COM.E_INVALIDARG);
          }
        } else if ((flags & COM.DISPATCH_PROPERTYGET) != 0) {
          // property get on the method itself
          try {
            Method gwtOnLoadMethod = getClass().getMethod("gwtOnLoad",
                new Class[] {IDispatch.class, String.class, String.class});
            MethodAdaptor methodAdaptor = new MethodAdaptor(gwtOnLoadMethod);
            IDispatchImpl funcObj = new MethodDispatch(null, methodAdaptor);
            IDispatch disp = new IDispatch(funcObj.getAddress());
            disp.AddRef();
            return new Variant(disp);
          } catch (Exception e) {
            // just return VT_EMPTY
            return new Variant();
          }
        }
        throw new HResultException(COM.E_NOTSUPPORTED);
      } else if (dispId == 2) {
        if ((flags & COM.DISPATCH_METHOD) != 0) {
          try {
            if (params.length < 1) {
              reportIncorrectInvocation("initModule", 1, params.length);
              throw new HResultException(COM.E_INVALIDARG);
            }
            String moduleName = (params[0].getType() == COM.VT_BSTR)
                ? params[0].getString() : null;
            boolean reload = initModule(moduleName);

            // boolean return type
            return new Variant(reload);
          } catch (SWTException e) {
            throw new HResultException(COM.E_INVALIDARG);
          }
        } else if ((flags & COM.DISPATCH_PROPERTYGET) != 0) {
          // property get on the method itself
          try {
            Method gwtOnLoadMethod = getClass().getMethod("initModule",
                new Class[] {String.class});
            MethodAdaptor methodAdaptor = new MethodAdaptor(gwtOnLoadMethod);
            IDispatchImpl funcObj = new MethodDispatch(null, methodAdaptor);
            IDispatch disp = new IDispatch(funcObj.getAddress());
            disp.AddRef();
            return new Variant(disp);
          } catch (Exception e) {
            // just return VT_EMPTY
            return new Variant();
          }
View Full Code Here


    if (variant == null) {
      return new Variant();
    }
    switch (variant.getType()) {
      case COM.VT_DISPATCH: {
        IDispatch dispatch = variant.getDispatch();
        dispatch.AddRef();
        return new Variant(dispatch);
      }
      case COM.VT_UNKNOWN: {
        IUnknown unknown = variant.getUnknown();
        unknown.AddRef();
View Full Code Here

    if (variant.getType() != COM.VT_DISPATCH) {
      return false;
    }

    // see if it has a valueOf method
    IDispatch dispatch = variant.getDispatch();
    int[] ids = oleAutomationGetIdsOfNames(dispatch);
    if (ids == null) {
      return false;
    }
    Variant result = null;
View Full Code Here

      if (dispObj == null || dispObj.refCount < 1) {
        dispObj = new IDispatchProxy(cl, val);
        cl.putWrapperForObject(val, dispObj);
      }
    }
    IDispatch disp = new IDispatch(dispObj.getAddress());
    disp.AddRef();
    setVariant(new Variant(disp));
  }
View Full Code Here

            IDispatchImpl dispMethod = (IDispatchImpl) classLoader.getWrapperForObject(obj);
            if (dispMethod == null || dispMethod.refCount < 1) {
              dispMethod = new MethodDispatch(classLoader, method);
              classLoader.putWrapperForObject(obj, dispMethod);
            }
            IDispatch disp = new IDispatch(dispMethod.getAddress());
            disp.AddRef();
            return new Variant(disp);
          }
        } else if (javaDispatch.isField(dispId)) {
          Field field = javaDispatch.getField(dispId);
          if (flags == COM.DISPATCH_PROPERTYGET) {
View Full Code Here

          IDispatchImpl dispMethod = (IDispatchImpl) classLoader.getWrapperForObject(obj);
          if (dispMethod == null || dispMethod.refCount < 1) {
            dispMethod = new MethodDispatch(classLoader, toStringMethod);
            classLoader.putWrapperForObject(obj, dispMethod);
          }
          IDispatch disp = new IDispatch(dispMethod.getAddress());
          disp.AddRef();
          return new Variant(disp);
        }
        break;
      case 2:
        // call
View Full Code Here

    if (variant == null) {
      return new Variant();
    }
    switch (variant.getType()) {
      case COM.VT_DISPATCH: {
        IDispatch dispatch = variant.getDispatch();
        dispatch.AddRef();
        return new Variant(dispatch);
      }
      case COM.VT_UNKNOWN: {
        IUnknown unknown = variant.getUnknown();
        unknown.AddRef();
View Full Code Here

    if (variant.getType() != COM.VT_DISPATCH) {
      return false;
    }

    // see if it has a valueOf method
    IDispatch dispatch = variant.getDispatch();
    int[] ids = oleAutomationGetIdsOfNames(dispatch);
    if (ids == null) {
      return false;
    }
    Variant result = null;
View Full Code Here

      if (dispObj == null || dispObj.refCount < 1) {
        dispObj = new IDispatchProxy(cl, val);
        cl.putWrapperForObject(val, dispObj);
      }
    }
    IDispatch disp = new IDispatch(dispObj.getAddress());
    disp.AddRef();
    setVariant(new Variant(disp));
  }
View Full Code Here

            IDispatchImpl dispMethod = (IDispatchImpl) classLoader.getWrapperForObject(obj);
            if (dispMethod == null || dispMethod.refCount < 1) {
              dispMethod = new MethodDispatch(classLoader, method);
              classLoader.putWrapperForObject(obj, dispMethod);
            }
            IDispatch disp = new IDispatch(dispMethod.getAddress());
            disp.AddRef();
            return new Variant(disp);
          }
        } else if (javaDispatch.isField(dispId)) {
          Field field = javaDispatch.getField(dispId);
          if (flags == COM.DISPATCH_PROPERTYGET) {
View Full Code Here

TOP

Related Classes of org.eclipse.swt.internal.ole.win32.IStream

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.