Skip to content

Latest commit

 

History

History
82 lines (70 loc) · 1.83 KB

File metadata and controls

82 lines (70 loc) · 1.83 KB
title ref (C++) | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
vc-attr.ref
dev_langs
C++
helpviewer_keywords
ref attribute
ms.assetid 67e82d3e-07d9-4ef8-bf2b-0a4491d12557
caps.latest.revision 9
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

ref (C++)

Identifies a reference pointer.

Syntax

  
[ref]  
  

Remarks

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

Example

The following code shows how to use the ref attribute:

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

Requirements

Attribute Context

Applies to typedef, interface parameter, interface method
Repeatable No
Required attributes None
Invalid attributes None

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

See Also

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