描述:
如下一个接口定义:
[ uuid(F58Fd2FF-F532-4733-0100-000000000000)]
dispinterface ISection
{
properties:
[id(0)] BSTR Name;
[id(1)] long SubSectionCount;
methods:
[id(100),propget] IDispatch* SubSections([in] VARIANT index);
[id(101)] long GetValueLong([in]BSTR strName, [in, defaultvalue(0)] long lDefValue);
[id(102)] BSTR GetValueString(BSTR strName, [in,defaultvalue("")] BSTR strDefValue);
[id(103)] double GetValueDouble(BSTR strName, [in,defaultvalue(0.0)] double dDefValue);
};
[uuid(CF86D8AE-C4C1-4529-0100-000000000000)]
coclass CoSection
{
[default] dispinterface ISection;
};
我为最后的几个方法指定了缺省值,但是在执行脚本的时候报错:方法的参数必需要指写。
脚本是VBScript 在肢本引擎内执行。 该对象由脚本宿主激发其一个对象的事件时的参数传入脚本内
解决方案1:
eg:
[bindable, propget] HRESULT get_Size(
[out, retval, defaultvalue("33")] long *nSize
);
你用“”把你的值引起来