Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

public (C++ Attributes)

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


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"
[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 to




Required attributes


Invalid attributes


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

Community Additions

© 2015 Microsoft