use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testGetDocumentation.
@Test
public void testGetDocumentation() {
ITypeInfo[] typeInfos = getTypeInfos();
MEMBERID memid = new MEMBERID(0);
BSTRByReference pBstrName = new BSTRByReference();
BSTRByReference pBstrDocString = new BSTRByReference();
DWORDByReference pdwHelpContext = new DWORDByReference();
BSTRByReference pBstrHelpFile = new BSTRByReference();
for (ITypeInfo typeInfo : typeInfos) {
HRESULT hr = typeInfo.GetDocumentation(memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
if (COMUtils.SUCCEEDED(hr)) {
//System.out.println("pBstrHelpFile: " + pBstrHelpFile.getValue());
return;
}
}
throw new RuntimeException("Didn't find documentation in any of the type infos");
}
use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class TypeLibUtil method getTypeInfo.
/**
* Gets the type info.
*
* @param index
* the index
* @return the type info
*/
public ITypeInfo getTypeInfo(int index) {
PointerByReference ppTInfo = new PointerByReference();
HRESULT hr = this.typelib.GetTypeInfo(new UINT(index), ppTInfo);
COMUtils.checkRC(hr);
return new TypeInfo(ppTInfo.getValue());
}
use of com.sun.jna.platform.win32.COM.ITypeInfo 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());
}
use of com.sun.jna.platform.win32.COM.ITypeInfo 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();
}
use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testAddressOfMember.
@Test
@Ignore("Needs a DLL that contains code")
public void testAddressOfMember() {
ITypeInfo[] typeInfos = getTypeInfos();
MEMBERID memid = new MEMBERID();
PointerByReference ppv = new PointerByReference();
for (ITypeInfo typeInfo : typeInfos) {
HRESULT hr = typeInfo.AddressOfMember(memid, INVOKEKIND.INVOKE_FUNC, ppv);
if (COMUtils.SUCCEEDED(hr)) {
//System.out.println("AddressOfMember: " + ppv.toString());
return;
}
}
throw new RuntimeException("Didn't find address for function in any of the type infos");
}
Aggregations