◄Up► ◄Contents► ◄Index► ◄Back► ─────C/C++ Language───────────────────────────────────────────────────────── Keyword: __export Syntax: __export declarator Summary: Specifies that a symbol is exported from a dynamic-link library (DLL). Any of the following can be declared as __export: ■ Data ■ Functions ■ Member functions ■ Constructors ■ Destructors ■ Operators See also: LINK, IMPLIB ◄EXPORTS Statement► ◄Module-Definition Files► The main use for __export is to export symbols that reside in a dynamic-link library. You can also need to export call-back functions for Microsoft Windows or for PWB extensions. When you use the __export keyword, the linker assumes the exported symbol has the following attributes: ■ No input/output (I/O) privileges ■ Shared data ■ Not resident ■ No alias name If you want to alter these attributes, you must use a module-definition (.DEF) file with an EXPORTS statement when building a DLL. See: ◄EXPORTS Statement► The __export keyword also causes the compiler to enter the size, in words, of the function's parameters into the export record of the object module. This size information corresponds to the <pwords> field of an EXPORTS statement that is in a .DEF file. You cannot override the size information in the export record with an EXPORTS entry in the .DEF file. If you have an EXPORTS entry for a function, the <pwords> field in the .DEF file should be set either to 0 (which tells the linker to use the value given by the compiler) or to the same value given by the compiler. The <pwords> field is ignored unless you also request I/O privilege. You can create an import library for a DLL in the following manner: 1. Provide a .DEF file entry for every symbol that you want to export. 2. Use the IMPLIB utility. It creates a file with a .LIB extension for use by the linker. Specify the .LIB file on the LINK line with the other libraries. See: ◄IMPLIB Summary► The following statement declares funcsample as a far Pascal function that takes a single argument of any pointer type and does not return a value. The presence of __export causes the function to be exported. void __export __far __pascal funcsample( void *s ); -♦-