Search in sources :

Example 1 with HRESULT

use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.

the class ITypeInfoTest method testGetMops.

@Test
public void testGetMops() {
    ITypeInfo typeInfo = getTypeInfo();
    MEMBERID memid = new MEMBERID(0);
    BSTRByReference pBstrMops = new BSTRByReference();
    HRESULT hr = typeInfo.GetMops(memid, pBstrMops);
    COMUtils.checkRC(hr);
    assertEquals(0, hr.intValue());
//System.out.println("pBstrMops: " + pBstrMops.toString());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) MEMBERID(com.sun.jna.platform.win32.OaIdl.MEMBERID) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference) Test(org.junit.Test)

Example 2 with HRESULT

use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.

the class ITypeInfoTest method testGetImplTypeFlags.

@Test
public void testGetImplTypeFlags() {
    ITypeInfo typeInfo = getTypeInfo();
    IntByReference pImplTypeFlags = new IntByReference();
    HRESULT hr = typeInfo.GetImplTypeFlags(new UINT(0), pImplTypeFlags);
    COMUtils.checkRC(hr);
    assertEquals(0, hr.intValue());
//System.out.println("GetImplTypeFlags: " + pImplTypeFlags.toString());
}
Also used : IntByReference(com.sun.jna.ptr.IntByReference) HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) UINT(com.sun.jna.platform.win32.WinDef.UINT) Test(org.junit.Test)

Example 3 with HRESULT

use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.

the class ITypeLibTest method testGetTypeInfoType.

public void testGetTypeInfoType() {
    ITypeLib shellTypeLib = loadShellTypeLib();
    TYPEKIND.ByReference pTKind = new TYPEKIND.ByReference();
    HRESULT hr = shellTypeLib.GetTypeInfoType(new UINT(0), pTKind);
    assertTrue(COMUtils.SUCCEEDED(hr));
//System.out.println("TYPEKIND: " + pTKind);
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference) USHORTByReference(com.sun.jna.platform.win32.WinDef.USHORTByReference) UINT(com.sun.jna.platform.win32.WinDef.UINT) TYPEKIND(com.sun.jna.platform.win32.OaIdl.TYPEKIND)

Example 4 with HRESULT

use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.

the class ITypeLibTest method testGetTypeComp.

public void testGetTypeComp() {
    ITypeLib shellTypeLib = loadShellTypeLib();
    PointerByReference pbr = new PointerByReference();
    HRESULT hr = shellTypeLib.GetTypeComp(pbr);
    // Only check that call works
    assertTrue(COMUtils.SUCCEEDED(hr));
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 5 with HRESULT

use of com.sun.jna.platform.win32.WinNT.HRESULT in project jna by java-native-access.

the class ITypeLibTest method testLibAttr.

public void testLibAttr() {
    ITypeLib shellTypeLib = loadShellTypeLib();
    PointerByReference pbr = new PointerByReference();
    HRESULT hr = shellTypeLib.GetLibAttr(pbr);
    assertTrue(COMUtils.SUCCEEDED(hr));
    OaIdl.TLIBATTR tlibAttr = new OaIdl.TLIBATTR(pbr.getValue());
    assertEquals(SHELL_CLSID, tlibAttr.guid.toGuidString());
    assertEquals(SHELL_MAJOR, tlibAttr.wMajorVerNum.intValue());
    assertEquals(SHELL_MINOR, tlibAttr.wMinorVerNum.intValue());
    shellTypeLib.ReleaseTLibAttr(tlibAttr);
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference) OaIdl(com.sun.jna.platform.win32.OaIdl)

Aggregations

HRESULT (com.sun.jna.platform.win32.WinNT.HRESULT)102 PointerByReference (com.sun.jna.ptr.PointerByReference)57 Test (org.junit.Test)26 REFIID (com.sun.jna.platform.win32.Guid.REFIID)20 UINT (com.sun.jna.platform.win32.WinDef.UINT)15 WString (com.sun.jna.WString)12 DWORD (com.sun.jna.platform.win32.WinDef.DWORD)12 WinNT (com.sun.jna.platform.win32.WinNT)12 DWORDByReference (com.sun.jna.platform.win32.WinDef.DWORDByReference)11 VARIANT (com.sun.jna.platform.win32.Variant.VARIANT)10 MEMBERID (com.sun.jna.platform.win32.OaIdl.MEMBERID)9 BSTRByReference (com.sun.jna.platform.win32.WTypes.BSTRByReference)9 ULONG (com.sun.jna.platform.win32.WinDef.ULONG)9 IID (com.sun.jna.platform.win32.Guid.IID)8 DISPIDByReference (com.sun.jna.platform.win32.OaIdl.DISPIDByReference)8 IntByReference (com.sun.jna.ptr.IntByReference)8 UINTByReference (com.sun.jna.platform.win32.WinDef.UINTByReference)7 COMException (com.sun.jna.platform.win32.COM.COMException)6 ConnectionPoint (com.sun.jna.platform.win32.COM.ConnectionPoint)6 Pointer (com.sun.jna.Pointer)5