Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

pragma

Emits the specified string, without the quote characters, into the generated .idl file.

[ pragma(
   pragma_statement
) ];

Parameter

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

Attribute Context

Applies to Anywhere
Repeatable No
Required attributes None
Invalid attributes None

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

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

See Also

IDL Attributes | Stand-Alone Attributes | pack | Attributes Samples

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.