0

你将如何在 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% 确定这是类型的问题。

4

1 回答 1

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);
于 2009-07-30T21:00:02.323 回答