public(C++ 特性)

确保 typedef 将进入类型库,即使未引用从 .idl 文件内。

[public]

备注

公共 C++ 特性具有与 公共 MIDL 属性相同。

示例

下面的代码演示如何使用 公共 属性:

// 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);
};

要求

属性上下文

适用对象

typedef

可重复

必需的特性

无效的特性

有关属性上下文的更多信息,请参见 属性上下文

请参见

其他资源

IDL 特性

Typedef、Enum、Union 和 Struct 特性

Attributes Samples