retval

return-type function-name([out, retval
                                     [, optional-attributes]] data-type * retval)

Examples

HRESULT MyMethod([out, retval] InMyFace** retval);

HRESULT MyOtherMethod([out, retval] boolean* retval);

 

Remarks

The retval attribute designates the parameter that receives the return value of the member. You can use this atttribute on parameters of interface members that describe methods or get properties. (The attribute is required on the last parameter of a method that has the propget attribute.) Note that the parameter takes the name of the attribute. The parameter must have the out attribute and must be a pointer type.

You cannot apply the optional attribute to a retval parameter.

The MIDL compiler accepts the following parameter ordering (from left-to-right):

  1.  Required parameters (parameters that do not have the defaultvalue or optional attributes),

  2.  optional parameters with or without the defaultvalueHDLFGB attribute,

  3.  parameters with the optional1JFN0T8 attribute and without the defaultvalue attribute,

  4.  lcid3KQO.S8 parameter, if any,

  5.  retval parameter

 

Parameters with the retval attribute are not displayed in user-oriented browsers.

Flags

IDLFLAG_FRETVAL

See Also

TYPEFLAGS, ODL File Syntax, ODL File Example, Generating a Type Library With MIDL, Differences Between MIDL and MKTYPLIB