将`null`参数从jscript传递到COM接口?

时间:2013-02-12 12:53:00

标签: com null jscript

考虑以下接口定义:

[
    //...
    dual,
    //...
]
interface IFoo : IDispatch{
}

[
    //...
    dual,
    //...
]
interface IBar : IDispatch{
  [propput, id(1)] HRESULT foo([in] IFoo* newVal);
};

我正在使用JScript中实现IBar的对象:

myBar.foo = someFoo; //到目前为止一切顺利

如何将foo设为null

myBar.foo = null; //“类型不匹配”

myBar.foo = 0; //“类型不匹配”

1 个答案:

答案 0 :(得分:0)

答案是:这是不可能的。