Article ID: 107501 - View products that this article applies to.
This article was previously published under Q107501
This article has been archived. It is offered "as is" and will no longer be updated.
The __export keyword provided with the Visual C++ for Windows compiler is obsolete with the Microsoft Visual C++ 32-bit compiler. The equivalent functionality for WIN32 can be achieved by using the keyword __declspec with the dllexport attribute. With Visual C++ 32-bit Edition, version 4.0, compiling code containing the __export (or _export) keyword results in either of the following warnings:
C4236: nonstandard extension used : '__export' is an obsolete keyword, see documentation for __declspec(dllexport)
- or -
Compiling code containing the __export (or _export) keyword with 32-bit Visual C++, versions 1.0 and 2.x, results in the C4226 warning.
C4226: nonstandard extension used : '__export' is an obsolete keyword
The __declspec construct is not supported by the tools supplied with Microsoft Win32 Software Development Kit (SDK).
When porting DLL source code from Windows to Win32, replace each instance of __export with __declspec( dllexport ). The __declspec(dllexport) keyword can be used to export data, functions, classes, or class member functions. For example:
The sample code below demonstrates exporting classes and class member functions from a DLL using the __declspec( dllexport ) and __declspec( dllimport ) storage class attributes in the DLL and EXE, respectively.
For more information on exporting, query on the following words in the Microsoft Knowledge Base:
__export and def and prolog and dllexportFor more information creating DLLs for WIN32 or on the dllexport and dllimport storage class attributes, refer to Chapter 4 of the "Programming Techniques" manual that ships with Visual C++ 32-bit Edition, or search for dllexport or dllimport or export in the Visual C++ Books Online. >From within the Visual Workbench, select Help and choose Keyword Search.
Article ID: 107501 - Last Review: February 24, 2014 - Revision: 3.0