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.

About our authors: Team EQA

You have viewed 1 page out of 27. Your DLL learning is 0.00% complete. Login to check your learning progress.

Learn on Youtube

#