use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testGetRefTypeOfImplType.
@Test
public void testGetRefTypeOfImplType() {
ITypeInfo typeInfo = getTypeInfo();
HREFTYPEByReference pRefType = new HREFTYPEByReference();
HRESULT hr = typeInfo.GetRefTypeOfImplType(new UINT(0), pRefType);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());
//System.out.println("GetRefTypeOfImplType: " + pRefType.toString());
}
use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testGetNames.
@Test
public void testGetNames() {
ITypeInfo[] typeInfos = getTypeInfos();
MEMBERID memid = new MEMBERID(1);
BSTR[] rgBstrNames = new BSTR[1];
UINT cMaxNames = new UINT(1);
UINTByReference pcNames = new UINTByReference();
for (ITypeInfo typeInfo : typeInfos) {
HRESULT hr = typeInfo.GetNames(memid, rgBstrNames, cMaxNames, pcNames);
if (COMUtils.SUCCEEDED(hr)) {
//System.out.println("pcNames: " + pcNames.getValue().intValue());
return;
}
}
throw new RuntimeException("Didn't find name for member in any of the type infos");
}
use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testGetIDsOfNames.
@Test
public void testGetIDsOfNames() {
ITypeInfo[] typeInfos = getTypeInfos();
LPOLESTR[] rgszNames = { new LPOLESTR("Help") };
UINT cNames = new UINT(1);
MEMBERID[] pMemId = new MEMBERID[1];
for (ITypeInfo typeInfo : typeInfos) {
HRESULT hr = typeInfo.GetIDsOfNames(rgszNames, cNames, pMemId);
if (COMUtils.SUCCEEDED(hr)) {
//System.out.println("pMemId: " + pMemId.toString());
return;
}
}
throw new RuntimeException("Didn't find Help in any of the type infos");
}
use of com.sun.jna.platform.win32.COM.ITypeInfo in project jna by java-native-access.
the class ITypeInfoTest method testGetDllEntry.
@Test
@Ignore("Needs a DLL that contains code")
public void testGetDllEntry() {
ITypeInfo[] typeInfos = getTypeInfos();
MEMBERID memid = new MEMBERID(0);
BSTRByReference pBstrDllName = new BSTRByReference();
BSTRByReference pBstrName = new BSTRByReference();
WORDByReference pwOrdinal = new WORDByReference();
for (ITypeInfo typeInfo : typeInfos) {
HRESULT hr = typeInfo.GetDllEntry(memid, INVOKEKIND.INVOKE_FUNC, pBstrDllName, pBstrName, pwOrdinal);
if (COMUtils.SUCCEEDED(hr)) {
//System.out.println("pwOrdinal: " + pwOrdinal.getValue());
return;
}
}
throw new RuntimeException("Didn't find Dll entry for member in any of the type infos");
}
Aggregations