use of com.sun.jna.platform.win32.OaIdl.DISPIDByReference in project jna by java-native-access.
the class IDispatchTest method testGetIDsOfNames.
public void testGetIDsOfNames() {
Dispatch dispatch = this.createIDispatch();
WString[] ptName = new WString[] { new WString("Application") };
DISPIDByReference pdispID = new DISPIDByReference();
HRESULT hr = dispatch.GetIDsOfNames(new REFIID(Guid.IID_NULL), ptName, 1, LOCALE_SYSTEM_DEFAULT, pdispID);
COMUtils.checkRC(hr);
assertEquals(0, hr.intValue());
}
use of com.sun.jna.platform.win32.OaIdl.DISPIDByReference in project jna by java-native-access.
the class ProxyObject method resolveDispId.
protected DISPID resolveDispId(final IDispatch pDisp, String name) {
assert COMUtils.comIsInitialized() : "COM not initialized";
if (pDisp == null)
throw new COMException("pDisp (IDispatch) parameter is null!");
// variable declaration
final WString[] ptName = new WString[] { new WString(name) };
final DISPIDByReference pdispID = new DISPIDByReference();
// Get DISPID for name passed...
HRESULT hr = pDisp.GetIDsOfNames(new REFIID(Guid.IID_NULL), ptName, 1, factory.getLCID(), pdispID);
COMUtils.checkRC(hr);
return pdispID.getValue();
}
use of com.sun.jna.platform.win32.OaIdl.DISPIDByReference in project jna by java-native-access.
the class COMBindingBaseObject method oleMethod.
protected HRESULT oleMethod(int nType, VARIANT.ByReference pvResult, IDispatch pDisp, String name, VARIANT[] pArgs) throws COMException {
if (pDisp == null)
throw new COMException("pDisp (IDispatch) parameter is null!");
// variable declaration
WString[] ptName = new WString[] { new WString(name) };
DISPIDByReference pdispID = new DISPIDByReference();
// Get DISPID for name passed...
HRESULT hr = pDisp.GetIDsOfNames(new REFIID(Guid.IID_NULL), ptName, 1, LOCALE_USER_DEFAULT, pdispID);
COMUtils.checkRC(hr);
return this.oleMethod(nType, pvResult, pDisp, pdispID.getValue(), pArgs);
}
Aggregations