说明

发出该指定字符串与生成的 .idl 文件,而不使用引号。.

[ pragma(
   pragma_statement
) ];

参数

  • pragma_statement
    批注。若要输入生成的 .idl 文件。

备注

说明 C++ 特性具有与 说明 MIDL 属性相同。

示例

// cpp_attr_ref_pragma.cpp
// compile with: /LD
#include "unknwn.h"
[module(name="MyLib")];
[pragma(pack(4))];

[dispinterface, uuid("00000000-0000-0000-0000-000000000001")]
__interface A
{
   [id(1)] HRESULT MyMethod ([in, satype("BSTR")] SAFEARRAY **p);
};

要求

属性上下文

适用对象

任何位置

可重复

必需的特性

无效的特性

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

请参见

参考

pack

其他资源

IDL特性

独立属性

Attributes Samples