2013-02-12 24 views
0

請看下面的接口定義:從jscript傳遞'null`參數到COM接口?

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

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

我和JScript中實現IBar對象工作:

myBar.foo = someFoo; //到目前爲止好

如何設置foonull

myBar.foo = null; // 「類型不匹配」

myBar.foo = 0; // 「類型不匹配」

+0

我不確定,但不應該在這裏選擇IFoo *嗎? – 2013-02-12 15:02:50

+0

@Anton Kovalenko可選'propput'參數? IDL中沒有這樣的東西。如果它存在,你會如何使用它? 'myBar.foo =?' – 2013-02-12 15:08:55

回答

0

答案是:這是不可能的。