Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 1.29 KB

pragma.md

File metadata and controls

59 lines (44 loc) · 1.29 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: pragma
pragma (C++ COM Attribute)
10/02/2018
vc-attr.pragma
pragma attribute
3f90d023-b8b5-4007-8311-008bb72cbea1

pragma

Emits the specified string into the generated .idl file without the use of quotation marks.

Syntax

[ pragma(pragma_statement) ];

Parameters

pragma_statement
The pragma that you want to go into the generated .idl file.

Remarks

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

Example

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

Requirements

Attribute context Value
Applies to Anywhere
Repeatable No
Required attributes None
Invalid attributes None

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

See also

IDL Attributes
Stand-Alone Attributes
pack