Provide complete information about the problem
- Version of JNA and related jars: 5.2.0
- Version and vendor of the java virtual machine: openjdk 11.0.2
- Operating System: Windows 10
- System architecture (CPU type, bitness of the JVM): x64
- Complete description of the Problem:
Setting a ComProperty with arguments allways only takes the first Argument.
We try to call this https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.irange.value as a ComProperty.
The IDL definition of this property is:
[propget, helpcontext(0x00023358)]
HRESULT _stdcall Value(
[in, optional] VARIANT RangeValueDataType,
[in, lcid] long lcid,
[out, retval] VARIANT* RHS);
[propput, helpcontext(0x00023358)]
HRESULT _stdcall Value(
[in, optional] VARIANT RangeValueDataType,
[in, lcid] long lcid,
[in] VARIANT RHS);
The JNA bindings are:
@ComProperty(name = "Value")
Object getValue(Object RangeValueDataType);
@ComProperty(name = "Value")
void setValue(Object RangeValueDataType, Object value);
I tryed to call it like this, but the cell is still empty:
range.setValue(Variant.VARIANT_MISSING, "test");
I tryed to call it like this, but the cell is filled with "10":
range.setValue(10, "test");
While debugging if found the following lines in ProxyObject#invoke, ignoring all the args with index > 0. i think this might be the reason for this.
if(dispId != -1) {
this.setProperty(new DISPID(dispId), args[0]);
return null;
} else {
String propName = this.getMutatorName(method, prop);
this.setProperty(propName, args[0]);
return null;
}
- Steps to reproduce:
I could provide an example running Excel 2016 and setting a cell, if needed?
Provide complete information about the problem
Setting a ComProperty with arguments allways only takes the first Argument.
We try to call this https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.excel.irange.value as a ComProperty.
The IDL definition of this property is:
[propget, helpcontext(0x00023358)]
HRESULT _stdcall Value(
[in, optional] VARIANT RangeValueDataType,
[in, lcid] long lcid,
[out, retval] VARIANT* RHS);
[propput, helpcontext(0x00023358)]
HRESULT _stdcall Value(
[in, optional] VARIANT RangeValueDataType,
[in, lcid] long lcid,
[in] VARIANT RHS);
The JNA bindings are:
I tryed to call it like this, but the cell is still empty:
range.setValue(Variant.VARIANT_MISSING, "test");
I tryed to call it like this, but the cell is filled with "10":
range.setValue(10, "test");
While debugging if found the following lines in ProxyObject#invoke, ignoring all the args with index > 0. i think this might be the reason for this.
if(dispId != -1) {
this.setProperty(new DISPID(dispId), args[0]);
return null;
} else {
String propName = this.getMutatorName(method, prop);
this.setProperty(propName, args[0]);
return null;
}
I could provide an example running Excel 2016 and setting a cell, if needed?