Importing functions - Importing a function from other module is done by placing the function entry in function list of .IDATA section. MS VC++ compiler has specific keyword __declspec(dllimport) to import a function or variable from an external module.
Syntax:
Functions: __declspec(dllimport) <function prototype>;
Variables: __declspec(dllimport) <type definition>;
Example:
__declspec(dllimport) int extrn_var;
__declspec(dllimport) int Function1(int a);
Exporting functions - 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);
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.
Questions index C Questions C++ Questions Win32 MFC COM/DCOM DLL Questions
Compilers & Editors
Download Visual Studio Download XCode Download Visual Studio Code Android studio install sdk Eclipse installer Best C compilers IDEs
Development system setup
Windows media creation tool MSDN subscription Ubuntu virtualbox
New updated posts
Why learn C? Calculate weighted average