Properties with Optional Parameters Not Supported

ID: Q131048

The information in this article applies to:

Properties with optional parameters are currently not supported by the IDispatch::Invoke implementation provided by the OLE system (DispInvoke and CreateStdDispatch). For example, the following results in an error from MKTYPLIB.EXE:

[propput]

void MyProperty([in] BSTR bstrValue, [in, optional] VARIANT vIndex,);
[propget] BSTR MyProperty([in, optional] VARIANT vIndex);

Properties with non-optional parameters are allowed. For example, the following is acceptable:

[propput] void MyProperty([in] short nIndex, [in] BSTR bstrValue); [propget] BSTR MyProperty([in] short nIndex);

Additional reference words: 2.0 2.00 3.50 4.00 KBCategory: kbprg kbole KBSubcategory: LeTwoAto

Last Reviewed: June 6, 1995