return-type func-name([optional [, other-attributes]] param-type param-name)
HRESULT MyFunc([in, optional] VARIANT Param1,
[out, optional] VARIANT Param2)
The optional attribute specifies an optional parameter for a member function. This attribute is valid only if the parameter is of type VARIANT or VARIANT*.
The MIDL compiler accepts the following parameter ordering (from left-to-right):
You cannot apply the optional attribute to a parameter that also has the lcid or retval attributes.
ODL File Syntax, ODL File Example, Generating a Type Library With MIDL, Differences Between MIDL and MKTYPLIB