1.

How Can I Export A Function From A Module?

Answer»

Exporting a function from a module is done by placing the function ENTRY in function list of .EDATA section. MS VC++ compiler has specific KEYWORD

_declspec(dllexport) to export a function or variable from a module.

Syntax:

Functions: __declspec(dllexport) <function prototype&GT;;
VARIABLES: __declspec(dllexport) <type definition>;

Example:

__declspec(dllexport) int extrn_var;
__declspec(dllexport) int Function1(int a);

The second method of exporting a method from a module is done by placing function name in a .def file in EXPORTS section. We have a later section export a function without __declspec(dllexport) keyword to discuss this in details.

Exporting a function from a module is done by placing the function entry in function list of .EDATA section. MS VC++ compiler has specific keyword

_declspec(dllexport) to export a function or variable from a module.

Syntax:

Functions: __declspec(dllexport) <function prototype>;
Variables: __declspec(dllexport) <type definition>;

Example:

__declspec(dllexport) int extrn_var;
__declspec(dllexport) int Function1(int a);

The second method of exporting a method from a module is done by placing function name in a .def file in EXPORTS section. We have a later section export a function without __declspec(dllexport) keyword to discuss this in details.



Discussion

No Comment Found