How do you express a int[] property in interface description language?
Question
How would you implement this property in IDL:
public int[] Params
{
get
{
return _Params;
}
set
{
_Params = value;
}
}
I tried the idl code below
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] int *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] int *RnewVal);
But my compiler is looking for this
public int get_Params()
{
throw new NotImplementedException();
}
public void set_Params(ref int rVal)
{
throw new NotImplementedException();
}
I'm 99.999% sure it's a problem with the types.
Solution
COM typelib importer prefers to deal with Automation-compliant interfaces, so use SAFEARRAY
:
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] SAFEARRAY(long) *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] SAFEARRAY(long) RnewVal);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow