Knowledge Base

Properties with Optional Parameters Not Supported

Article ID: 131048

Article Last Modified on 12/3/2003


APPLIES TO


This article was previously published under Q131048
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 query words: 2.0 2.00 3.50 4.00

Keywords: kbprogramming KB131048