pragma

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

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

  
      [ pragma(  
   pragma_statement  
) ];  

Parameters

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

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

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

Attribute Context

Applies toAnywhere
RepeatableNo
Required attributesNone
Invalid attributesNone

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

IDL Attributes
Stand-Alone Attributes
pack
Attributes Samples

Show: