Search in sources :

Example 36 with HRESULT

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

the class TypeInfoUtil method getRefTypeOfImplType.

/**
     * Gets the ref type of impl type.
     * 
     * @param index
     *            the index
     * @return the ref type of impl type
     */
public HREFTYPE getRefTypeOfImplType(int index) {
    HREFTYPEByReference ppTInfo = new HREFTYPEByReference();
    HRESULT hr = this.typeInfo.GetRefTypeOfImplType(new UINT(index), ppTInfo);
    COMUtils.checkRC(hr);
    return ppTInfo.getValue();
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) HREFTYPEByReference(com.sun.jna.platform.win32.OaIdl.HREFTYPEByReference) UINT(com.sun.jna.platform.win32.WinDef.UINT)

Example 37 with HRESULT

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

the class TypeInfoUtil method GetDllEntry.

/**
     * Gets the dll entry.
     * 
     * @param memid
     *            the memid
     * @param invKind
     *            the inv kind
     * @return the dll entry
     */
public DllEntry GetDllEntry(MEMBERID memid, INVOKEKIND invKind) {
    BSTRByReference pBstrDllName = new BSTRByReference();
    BSTRByReference pBstrName = new BSTRByReference();
    WORDByReference pwOrdinal = new WORDByReference();
    HRESULT hr = this.typeInfo.GetDllEntry(memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
    COMUtils.checkRC(hr);
    OLEAUTO.SysFreeString(pBstrDllName.getValue());
    OLEAUTO.SysFreeString(pBstrName.getValue());
    return new DllEntry(pBstrDllName.getString(), pBstrName.getString(), pwOrdinal.getValue().intValue());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference) DWORDByReference(com.sun.jna.platform.win32.WinDef.DWORDByReference) WORDByReference(com.sun.jna.platform.win32.WinDef.WORDByReference)

Example 38 with HRESULT

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

the class TypeInfoUtil method getRefTypeInfo.

/**
     * Gets the ref type info.
     * 
     * @param hreftype
     *            the hreftype
     * @return the ref type info
     */
public ITypeInfo getRefTypeInfo(HREFTYPE hreftype) {
    PointerByReference ppTInfo = new PointerByReference();
    HRESULT hr = this.typeInfo.GetRefTypeInfo(hreftype, ppTInfo);
    COMUtils.checkRC(hr);
    return new TypeInfo(ppTInfo.getValue());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 39 with HRESULT

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

the class TypeInfoUtil method GetContainingTypeLib.

/**
     * Gets the containing type lib.
     * 
     * @return the containing type lib
     */
public ContainingTypeLib GetContainingTypeLib() {
    PointerByReference ppTLib = new PointerByReference();
    UINTByReference pIndex = new UINTByReference();
    HRESULT hr = this.typeInfo.GetContainingTypeLib(ppTLib, pIndex);
    COMUtils.checkRC(hr);
    return new ContainingTypeLib(new TypeLib(ppTLib.getValue()), pIndex.getValue().intValue());
}
Also used : UINTByReference(com.sun.jna.platform.win32.WinDef.UINTByReference) HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference)

Example 40 with HRESULT

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

the class TypeInfoUtil method getTypeComp.

/**
     * Gets the type comp.
     * 
     * @return the type comp
     */
public TypeComp getTypeComp() {
    PointerByReference ppTypeAttr = new PointerByReference();
    HRESULT hr = this.typeInfo.GetTypeComp(ppTypeAttr);
    COMUtils.checkRC(hr);
    return new TypeComp(ppTypeAttr.getValue());
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) PointerByReference(com.sun.jna.ptr.PointerByReference)

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