use of com.sun.jna.platform.win32.WinDef.UINTByReference in project jna by java-native-access.
the class TypeInfoUtil method GetContainingTypeLib.
/**
* Gets the containing type lib.
*
* @return the containing type lib
*/
public ContainingTypeLib GetContainingTypeLib() {
PointerByReference ppTLib = new PointerByReference();
UINTByReference pIndex = new UINTByReference();
HRESULT hr = this.typeInfo.GetContainingTypeLib(ppTLib, pIndex);
COMUtils.checkRC(hr);
return new ContainingTypeLib(new TypeLib(ppTLib.getValue()), pIndex.getValue().intValue());
}
use of com.sun.jna.platform.win32.WinDef.UINTByReference in project jna by java-native-access.
the class TypeInfoUtil method Invoke.
/**
* Invoke.
*
* @param pvInstance
* the pv instance
* @param memid
* the memid
* @param wFlags
* the w flags
* @param pDispParams
* the disp params
* @return the invoke
*/
public Invoke Invoke(PVOID pvInstance, MEMBERID memid, WORD wFlags, DISPPARAMS.ByReference pDispParams) {
VARIANT.ByReference pVarResult = new VARIANT.ByReference();
EXCEPINFO.ByReference pExcepInfo = new EXCEPINFO.ByReference();
UINTByReference puArgErr = new UINTByReference();
HRESULT hr = this.typeInfo.Invoke(pvInstance, memid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
COMUtils.checkRC(hr);
return new Invoke(pVarResult, pExcepInfo, puArgErr.getValue().intValue());
}
use of com.sun.jna.platform.win32.WinDef.UINTByReference 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.UINTByReference in project jna by java-native-access.
the class IDispatchTest method testGetTypeInfoCount.
public void testGetTypeInfoCount() {
Dispatch dispatch = this.createIDispatch();
UINTByReference pctinfo = new UINTByReference();
dispatch.GetTypeInfoCount(pctinfo);
int intValue = pctinfo.getValue().intValue();
assertEquals(1, intValue);
}
use of com.sun.jna.platform.win32.WinDef.UINTByReference 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