use of com.sun.jna.platform.win32.WinDef.WORDByReference in project jna by java-native-access.
the class TypeInfoUtil method GetDllEntry.
/**
* Gets the dll entry.
*
* @param memid
* the memid
* @param invKind
* the inv kind
* @return the dll entry
*/
public DllEntry GetDllEntry(MEMBERID memid, INVOKEKIND invKind) {
BSTRByReference pBstrDllName = new BSTRByReference();
BSTRByReference pBstrName = new BSTRByReference();
WORDByReference pwOrdinal = new WORDByReference();
HRESULT hr = this.typeInfo.GetDllEntry(memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
COMUtils.checkRC(hr);
OLEAUTO.SysFreeString(pBstrDllName.getValue());
OLEAUTO.SysFreeString(pBstrName.getValue());
return new DllEntry(pBstrDllName.getString(), pBstrName.getString(), pwOrdinal.getValue().intValue());
}
use of com.sun.jna.platform.win32.WinDef.WORDByReference 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