use of com.sun.jna.platform.win32.COM.util.Factory in project jna by java-native-access.
the class ProxyObject method getProperty.
@Override
public <T> T getProperty(Class<T> returnType, DISPID dispID, Object... args) {
VARIANT[] vargs;
if (null == args) {
vargs = new VARIANT[0];
} else {
vargs = new VARIANT[args.length];
}
for (int i = 0; i < vargs.length; ++i) {
vargs[i] = Convert.toVariant(args[i]);
}
Variant.VARIANT.ByReference result = new Variant.VARIANT.ByReference();
WinNT.HRESULT hr = this.oleMethod(OleAuto.DISPATCH_PROPERTYGET, result, this.getRawDispatch(), dispID, vargs);
for (int i = 0; i < vargs.length; i++) {
// Free value allocated by Convert#toVariant
Convert.free(vargs[i], args[i]);
}
COMUtils.checkRC(hr);
return (T) Convert.toJavaObject(result, returnType, factory, false, true);
}
Aggregations