收录查询

[MSDN]Optimizing Your Code: Overview

(1) Pragmas and Coding Instructions That Affect Optimizations(影响优化的指令和伪指令/宏)
(2) Optimization Switches(优化开关/选项)
(3) how to optimize a DLL(如何优化DLL:对应dllimport, dllexport)

dllimport, dllexport

Microsoft Specific

__declspec( dllimport ) declarator

__declspec( dllexport ) declarator

The dllexport and dllimport storage-class attributes are Microsoft-specific extensions to the C and C++ languages. They enable you to export and import functions, data, and objects to and from a DLL. These attributes explicitly define the DLL’s interface to its client, which can be the executable file or another DLL. Declaring functions as dllexport eliminates the need for a module-definition (.DEF) file, at least with respect to the specification of exported functions. Note that dllexport replaces the __export keyword.

The declaration of dllexport and dllimport uses extended attribute syntax.

For more information, see __declspec.

Example

// Example of the dllimport and dllexport class attributes
__declspec( dllimport ) int i;
__declspec( dllexport ) void func();

END Microsoft Specific

posted @ 2006-01-01 01:39  ->  阅读(185)  评论(0)    收藏  举报