The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

Designates the parameter that receives the return value of the member.


The retval C++ attribute has the same functionality as the retval MIDL attribute.

retval must appear on the last argument in a function's declaration.

See the example for bindable for a sample use of retval.

Attribute Context

Applies toInterface parameter, interface method
Required attributesout
Invalid attributesin

For more information about the attribute contexts, see Attribute Contexts.

IDL Attributes
Parameter Attributes
Method Attributes
Attributes Samples