Skip to content

Latest commit

 

History

History
86 lines (70 loc) · 2.18 KB

File metadata and controls

86 lines (70 loc) · 2.18 KB
title export | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
vc-attr.export
dev_langs
C++
helpviewer_keywords
export attribute
ms.assetid 70b3e848-fad6-4e09-8c72-be60ca72a4df
caps.latest.revision 11
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

export

Causes a data structure to be placed in the .idl file.

Syntax

  
[export]  
  

Remarks

The export C++ attribute causes a data structure to be placed in the .idl file and to then be available in the type library in a binary-compatible format that makes it available for use with any language.

You cannot apply the export attribute to a class even if the class only has public members (the equivalent of a struct).

If you export unnamed enums or structs, they will be given names that begin with __unnamedx, where x is a sequential number.

The typedefs valid for export are base types, structs, unions, enums, or type identifiers. See typedef for more information.

Example

The following code shows how to use the export attribute:

// cpp_attr_ref_export.cpp  
// compile with: /LD  
[module(name="MyLibrary")];  
  
[export]  
struct MyStruct {  
   int i;  
};  

Requirements

Attribute Context

Applies to union, typedef, enum, struct, or interface
Repeatable No
Required attributes None
Invalid attributes None

For more information, see Attribute Contexts.

See Also

Compiler Attributes
Typedef, Enum, Union, and Struct Attributes