| 1. |
How Functions Are Imported And Exported In A Module? |
|
Answer» 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) ; Example: __declspec(dllimport) INT extrn_var; 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) ; Example: __declspec(dllexport) int extrn_var; 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) ; Example: __declspec(dllimport) int extrn_var; 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) ; Example: __declspec(dllexport) int extrn_var; |
|