如何在IDL中实现此属性:
public int[] Params
{
get
{
return _Params;
}
set
{
_Params = value;
}
}
我尝试了下面的idl代码
[propget, helpstring("The click through parameters")]
HRESULT Params([out, retval] int *rVal);
[propput, helpstring("The click through parameters")]
HRESULT Params([in] int *RnewVal);
但是我的编译器正在寻找这个
public int get_Params()
{
throw new NotImplementedException();
}
public void set_Params(ref int rVal)
{
throw new NotImplementedException();
}
我99.999%肯定这是类型的问题。
答案 0 :(得分:3)
COM typelib导入程序更喜欢处理符合自动化的接口,因此使用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);