Search in sources :

Example 1 with TYPEDESC

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

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

the class COMTest method testTYPEATTR.

public void testTYPEATTR() {
    int pSize = Native.POINTER_SIZE;
    TYPEATTR typeAttr = new TYPEATTR();
    typeAttr.guid = GUID.fromString("{50A7E9B0-70EF-11D1-B75A-00A0C90564FE}");
    typeAttr.lcid = Kernel32.INSTANCE.GetSystemDefaultLCID();
    typeAttr.dwReserved = new DWORD(1);
    typeAttr.memidConstructor = new MEMBERID(2);
    typeAttr.memidDestructor = new MEMBERID(3);
    typeAttr.lpstrSchema = new LPOLESTR("Hello World");
    typeAttr.cbSizeInstance = new ULONG(4);
    typeAttr.typekind = new TYPEKIND(5);
    typeAttr.cFuncs = new WORD(6);
    typeAttr.cVars = new WORD(7);
    typeAttr.cImplTypes = new WORD(8);
    typeAttr.cbSizeVft = new WORD(9);
    typeAttr.cbAlignment = new WORD(10);
    typeAttr.wMajorVerNum = new WORD(11);
    typeAttr.wMinorVerNum = new WORD(12);
    typeAttr.tdescAlias = new TYPEDESC();
    typeAttr.idldescType = new IDLDESC();
    typeAttr.write();
    typeAttr.read();
//System.out.println(typeAttr.toString());
//System.out.println("TYPEATTR size: " + typeAttr.size());
}
Also used : ULONG(com.sun.jna.platform.win32.WinDef.ULONG) DWORD(com.sun.jna.platform.win32.WinDef.DWORD) WORD(com.sun.jna.platform.win32.WinDef.WORD) MEMBERID(com.sun.jna.platform.win32.OaIdl.MEMBERID) TYPEDESC(com.sun.jna.platform.win32.OaIdl.TYPEDESC) TYPEATTR(com.sun.jna.platform.win32.OaIdl.TYPEATTR) LPOLESTR(com.sun.jna.platform.win32.WTypes.LPOLESTR) DWORD(com.sun.jna.platform.win32.WinDef.DWORD) IDLDESC(com.sun.jna.platform.win32.OaIdl.IDLDESC) TYPEKIND(com.sun.jna.platform.win32.OaIdl.TYPEKIND)

Aggregations

TYPEDESC (com.sun.jna.platform.win32.OaIdl.TYPEDESC)2 HREFTYPE (com.sun.jna.platform.win32.OaIdl.HREFTYPE)1 IDLDESC (com.sun.jna.platform.win32.OaIdl.IDLDESC)1 MEMBERID (com.sun.jna.platform.win32.OaIdl.MEMBERID)1 TYPEATTR (com.sun.jna.platform.win32.OaIdl.TYPEATTR)1 TYPEKIND (com.sun.jna.platform.win32.OaIdl.TYPEKIND)1 LPOLESTR (com.sun.jna.platform.win32.WTypes.LPOLESTR)1 VARTYPE (com.sun.jna.platform.win32.WTypes.VARTYPE)1 DWORD (com.sun.jna.platform.win32.WinDef.DWORD)1 ULONG (com.sun.jna.platform.win32.WinDef.ULONG)1 WORD (com.sun.jna.platform.win32.WinDef.WORD)1