public (C++ Attributes)

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

Ensures that a typedef will go into the type library even if it is not referenced from within the .idl file.

  
[public]  
  

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

The following code shows how to use the public attribute:

// cpp_attr_ref_public.cpp  
// compile with: /LD  
#include "unknwn.h"  
[module(name="ATLFIRELib")];  
[export, public] typedef long MEMBERID;  
  
[dispinterface, uuid(99999999-9999-9999-9999-000000000000)]  
__interface IFireTabCtrl : IDispatch  
{  
   [id(2)] long procedure ([in, optional] VARIANT i);  
};  

Attribute Context

Applies totypedef
RepeatableNo
Required attributesNone
Invalid attributesNone

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

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

Show: