Search in sources :

Example 1 with TYPEKIND

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

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

the class TypeLibUtil method getTypeInfoType.

/**
     * Gets the type info type.
     * 
     * @param index
     *            the index
     * @return the type info type
     */
public TYPEKIND getTypeInfoType(int index) {
    TYPEKIND.ByReference typekind = new TYPEKIND.ByReference();
    HRESULT hr = this.typelib.GetTypeInfoType(new UINT(index), typekind);
    COMUtils.checkRC(hr);
    return typekind;
}
Also used : HRESULT(com.sun.jna.platform.win32.WinNT.HRESULT) DWORDByReference(com.sun.jna.platform.win32.WinDef.DWORDByReference) BSTRByReference(com.sun.jna.platform.win32.WTypes.BSTRByReference) PointerByReference(com.sun.jna.ptr.PointerByReference) BOOLByReference(com.sun.jna.platform.win32.WinDef.BOOLByReference) 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 3 with TYPEKIND

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

the class TlbImp method startCOM2Java.

/**
     * Start startCOM2Java.
     */
public void startCOM2Java() {
    try {
        // create output Dir
        this.createDir();
        String bindingMode = this.cmdlineArgs.getBindingMode();
        int typeInfoCount = typeLibUtil.getTypeInfoCount();
        for (int i = 0; i < typeInfoCount; ++i) {
            TYPEKIND typekind = typeLibUtil.getTypeInfoType(i);
            if (typekind.value == TYPEKIND.TKIND_ENUM) {
                this.createCOMEnum(i, this.getPackageName(), typeLibUtil);
            } else if (typekind.value == TYPEKIND.TKIND_RECORD) {
                TlbImp.logInfo("'TKIND_RECORD' objects are currently not supported!");
            } else if (typekind.value == TYPEKIND.TKIND_MODULE) {
                TlbImp.logInfo("'TKIND_MODULE' objects are currently not supported!");
            } else if (typekind.value == TYPEKIND.TKIND_INTERFACE) {
                this.createCOMInterface(i, this.getPackageName(), typeLibUtil);
            } else if (typekind.value == TYPEKIND.TKIND_DISPATCH) {
                this.createCOMDispInterface(i, this.getPackageName(), typeLibUtil);
            } else if (typekind.value == TYPEKIND.TKIND_COCLASS) {
                this.createCOMCoClass(i, this.getPackageName(), typeLibUtil, bindingMode);
            } else if (typekind.value == TYPEKIND.TKIND_ALIAS) {
                TlbImp.logInfo("'TKIND_ALIAS' objects are currently not supported!");
            } else if (typekind.value == TYPEKIND.TKIND_UNION) {
                TlbImp.logInfo("'TKIND_UNION' objects are currently not supported!");
            }
        }
        logInfo(typeInfoCount + " files sucessfully written to: " + this.comRootDir.toString());
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : TYPEKIND(com.sun.jna.platform.win32.OaIdl.TYPEKIND) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException)

Example 4 with TYPEKIND

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

TYPEKIND (com.sun.jna.platform.win32.OaIdl.TYPEKIND)4 UINT (com.sun.jna.platform.win32.WinDef.UINT)2 USHORTByReference (com.sun.jna.platform.win32.WinDef.USHORTByReference)2 HRESULT (com.sun.jna.platform.win32.WinNT.HRESULT)2 PointerByReference (com.sun.jna.ptr.PointerByReference)2 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 TYPEDESC (com.sun.jna.platform.win32.OaIdl.TYPEDESC)1 BSTRByReference (com.sun.jna.platform.win32.WTypes.BSTRByReference)1 LPOLESTR (com.sun.jna.platform.win32.WTypes.LPOLESTR)1 BOOLByReference (com.sun.jna.platform.win32.WinDef.BOOLByReference)1 DWORD (com.sun.jna.platform.win32.WinDef.DWORD)1 DWORDByReference (com.sun.jna.platform.win32.WinDef.DWORDByReference)1 ULONG (com.sun.jna.platform.win32.WinDef.ULONG)1 WORD (com.sun.jna.platform.win32.WinDef.WORD)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1