ref (C++)


For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Identifies a reference pointer.


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

The following code shows how to use the ref attribute:

// cpp_attr_ref_ref.cpp  
// compile with: /LD  
#include <windows.h>   
[dispinterface, uuid("00000000-0000-0000-0000-000000000001")]  
__interface IFireTabCtrl  
   [id(1), unique] char * GetFirstName([in, ref] char * pszFullName );   

Attribute Context

Applies totypedef, interface parameter, interface method
Required attributesNone
Invalid attributesNone

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

IDL Attributes
Typedef, Enum, Union, and Struct Attributes
Parameter Attributes
Attributes Samples