Package com.sun.jna.platform.win32.WinNT

Examples of com.sun.jna.platform.win32.WinNT.HRESULT


    }

    public COMBindingBaseObject(String progId, boolean useActiveInstance,
            int dwClsContext) throws COMException {
        // Initialize COM for this thread...
        HRESULT hr = Ole32.INSTANCE.CoInitialize(null);

        if (COMUtils.FAILED(hr)) {
            this.release();
            throw new COMException("CoInitialize() failed!");
        }
View Full Code Here


        // variable declaration
        WString[] ptName = new WString[] { new WString(name) };
        DISPIDByReference pdispID = new DISPIDByReference();

        // Get DISPID for name passed...
        HRESULT hr = pDisp.GetIDsOfNames(Guid.IID_NULL, ptName, 1,
                LOCALE_USER_DEFAULT, pdispID);

        COMUtils.checkRC(hr);

        return this
View Full Code Here

            // 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);

        COMUtils.checkRC(hr, pExcepInfo, puArgErr);
        return hr;
    }
View Full Code Here

   *            original w32 error code
   * @return the converted value
   */
  public static final HRESULT HRESULT_FROM_WIN32(int x) {
    int f = FACILITY_WIN32;
    return new HRESULT(x <= 0 ? x : ((x) & 0x0000FFFF) | (f <<= 16)
        | 0x80000000);
  }
View Full Code Here

        try {
            PointerByReference pDispatch = new PointerByReference();

            // Get CLSID for Word.Application...
            CLSID.ByReference clsid = new CLSID.ByReference();
            HRESULT hr = Ole32.INSTANCE.CLSIDFromProgID("Shell.Application",
                    clsid);

            if (W32Errors.FAILED(hr)) {
                Ole32.INSTANCE.CoUninitialize();
                COMUtils.checkRC(hr);
View Full Code Here

    }

    @Override
    protected void setUp() throws Exception {
        // Initialize COM for this thread...
        HRESULT hr = Ole32.INSTANCE.CoInitialize(null);

        if (W32Errors.FAILED(hr)) {
            this.tearDown();
            throw new COMException("CoInitialize() failed");
        }
View Full Code Here

    public void testGetTypeInfo() {
        Dispatch dispatch = this.createIDispatch();
       
        PointerByReference ppTInfo = new PointerByReference();
        HRESULT hr = dispatch.GetTypeInfo(new UINT(0), LOCALE_SYSTEM_DEFAULT, ppTInfo);
       
        COMUtils.checkRC(hr);
        assertEquals(0, hr.intValue());
    }
View Full Code Here

        Dispatch dispatch = this.createIDispatch();
       
        WString[] ptName = new WString[] { new WString("Application") };
        DISPIDByReference pdispID = new DISPIDByReference();

        HRESULT hr = dispatch.GetIDsOfNames(Guid.IID_NULL, ptName, 1, LOCALE_SYSTEM_DEFAULT, pdispID);
        COMUtils.checkRC(hr);
        assertEquals(0, hr.intValue());
    }
View Full Code Here

        ITypeInfo typeInfo = getTypeInfo();
        MEMBERID memid = new MEMBERID(1);
        BSTR[] rgBstrNames = new BSTR[1];
        UINT cMaxNames = new UINT(1);
        UINTByReference pcNames = new UINTByReference();
        HRESULT hr = typeInfo.GetNames(memid, rgBstrNames, cMaxNames, pcNames);

        COMUtils.checkRC(hr);
        assertEquals(0, hr.intValue());
        //System.out.println("rgBstrNames: " + rgBstrNames[0].getValue());
        //System.out.println("pcNames: " + pcNames.getValue().intValue());
    }
View Full Code Here

    }

    public void testGetRefTypeOfImplType() {
        ITypeInfo typeInfo = getTypeInfo();
        HREFTYPEByReference pRefType = new HREFTYPEByReference();
        HRESULT hr = typeInfo.GetRefTypeOfImplType(new UINT(0), pRefType);

        COMUtils.checkRC(hr);
        assertEquals(0, hr.intValue());
        //System.out.println("GetRefTypeOfImplType: " + pRefType.toString());
    }
View Full Code Here

TOP

Related Classes of com.sun.jna.platform.win32.WinNT.HRESULT

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.