Search in sources :

Example 1 with HREFTYPE

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

the class TlbAbstractMethod method getType.

protected String getType(TYPEDESC typeDesc) {
    VARTYPE vt = typeDesc.vt;
    String type = "not_defined";
    if (vt.intValue() == Variant.VT_PTR) {
        TYPEDESC lptdesc = typeDesc._typedesc.getLptdesc();
        type = this.getType(lptdesc);
    } else if (vt.intValue() == Variant.VT_SAFEARRAY || vt.intValue() == Variant.VT_CARRAY) {
        TYPEDESC tdescElem = typeDesc._typedesc.getLpadesc().tdescElem;
        type = this.getType(tdescElem);
    } else if (vt.intValue() == Variant.VT_USERDEFINED) {
        HREFTYPE hreftype = typeDesc._typedesc.hreftype;
        type = this.getUserdefinedType(hreftype);
    } else {
        type = this.getVarType(vt);
    }
    return type;
}
Also used : TYPEDESC(com.sun.jna.platform.win32.OaIdl.TYPEDESC) HREFTYPE(com.sun.jna.platform.win32.OaIdl.HREFTYPE) VARTYPE(com.sun.jna.platform.win32.WTypes.VARTYPE)

Example 2 with HREFTYPE

use of com.sun.jna.platform.win32.OaIdl.HREFTYPE 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 3 with HREFTYPE

use of com.sun.jna.platform.win32.OaIdl.HREFTYPE 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 4 with HREFTYPE

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

the class TlbAbstractMethod method getUserdefinedType.

protected String getUserdefinedType(HREFTYPE hreftype) {
    ITypeInfo refTypeInfo = this.typeInfoUtil.getRefTypeInfo(hreftype);
    TypeInfoUtil typeInfoUtil = new TypeInfoUtil(refTypeInfo);
    TypeInfoDoc documentation = typeInfoUtil.getDocumentation(OaIdl.MEMBERID_NIL);
    return documentation.getName();
}
Also used : TypeInfoUtil(com.sun.jna.platform.win32.COM.TypeInfoUtil) TypeInfoDoc(com.sun.jna.platform.win32.COM.TypeInfoUtil.TypeInfoDoc) ITypeInfo(com.sun.jna.platform.win32.COM.ITypeInfo)

Aggregations

HRESULT (com.sun.jna.platform.win32.WinNT.HRESULT)2 ITypeInfo (com.sun.jna.platform.win32.COM.ITypeInfo)1 TypeInfoUtil (com.sun.jna.platform.win32.COM.TypeInfoUtil)1 TypeInfoDoc (com.sun.jna.platform.win32.COM.TypeInfoUtil.TypeInfoDoc)1 HREFTYPE (com.sun.jna.platform.win32.OaIdl.HREFTYPE)1 HREFTYPEByReference (com.sun.jna.platform.win32.OaIdl.HREFTYPEByReference)1 TYPEDESC (com.sun.jna.platform.win32.OaIdl.TYPEDESC)1 VARTYPE (com.sun.jna.platform.win32.WTypes.VARTYPE)1 UINT (com.sun.jna.platform.win32.WinDef.UINT)1 PointerByReference (com.sun.jna.ptr.PointerByReference)1