Search in sources :

Example 1 with TLIBATTR

use of com.sun.jna.platform.win32.OaIdl.TLIBATTR 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)

Example 2 with TLIBATTR

use of com.sun.jna.platform.win32.OaIdl.TLIBATTR in project jna by java-native-access.

the class TypeLibUtil method getLibAttr.

/**
     * Gets the lib attr.
     * 
     * @return the lib attr
     */
public TLIBATTR getLibAttr() {
    PointerByReference ppTLibAttr = new PointerByReference();
    HRESULT hr = typelib.GetLibAttr(ppTLibAttr);
    COMUtils.checkRC(hr);
    return new TLIBATTR(ppTLibAttr.getValue());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference) TLIBATTR(com.sun.jna.platform.win32.OaIdl.TLIBATTR)

Aggregations

HRESULT (com.sun.jna.platform.win32.WinNT.HRESULT)2 PointerByReference (com.sun.jna.ptr.PointerByReference)2 OaIdl (com.sun.jna.platform.win32.OaIdl)1 TLIBATTR (com.sun.jna.platform.win32.OaIdl.TLIBATTR)1