use of com.sun.jna.platform.win32.WinDef.UINT in project jna by java-native-access.
the class TypeInfoUtil method getIDsOfNames.
/**
* Gets the i ds of names.
*
* @param rgszNames
* the rgsz names
* @param cNames
* the c names
* @return the i ds of names
*/
public MEMBERID[] getIDsOfNames(LPOLESTR[] rgszNames, int cNames) {
MEMBERID[] pMemId = new MEMBERID[cNames];
HRESULT hr = this.typeInfo.GetIDsOfNames(rgszNames, new UINT(cNames), pMemId);
COMUtils.checkRC(hr);
return pMemId;
}
use of com.sun.jna.platform.win32.WinDef.UINT in project jna by java-native-access.
the class TypeInfoUtil method getNames.
/**
* Gets the names.
*
* @param memid
* the memid
* @param maxNames
* the max names
* @return the names
*/
public String[] getNames(MEMBERID memid, int maxNames) {
BSTR[] rgBstrNames = new BSTR[maxNames];
UINTByReference pcNames = new UINTByReference();
HRESULT hr = this.typeInfo.GetNames(memid, rgBstrNames, new UINT(maxNames), pcNames);
COMUtils.checkRC(hr);
int cNames = pcNames.getValue().intValue();
String[] result = new String[cNames];
for (int i = 0; i < result.length; i++) {
result[i] = rgBstrNames[i].getValue();
OLEAUTO.SysFreeString(rgBstrNames[i]);
}
return result;
}
use of com.sun.jna.platform.win32.WinDef.UINT in project jna by java-native-access.
the class IDispatchTest method testGetTypeInfo.
public void testGetTypeInfo() {
Dispatch dispatch = this.createIDispatch();
PointerByReference ppTInfo = new PointerByReference();
HRESULT hr = dispatch.GetTypeInfo(new UINT(0), LOCALE_SYSTEM_DEFAULT, ppTInfo);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());
}
use of com.sun.jna.platform.win32.WinDef.UINT 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.WinDef.UINT 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");
}
Aggregations