Modules are a fundamental structural unit in Windows. There are two types of modules: application modules and dynamic-link modules. You should already be familiar with application modules; the .EXE file for every Windows application is considered a module. Examples of dynamic-link modules include any Windows system file with an extension of .DLL, .DRV, or .FON. (Some Windows system modules have a filename extension of .EXE instead of .DLL.)
Application and dynamic-link modules have the same file format. This format, which is sometimes called the New EXE Header Format, allows dynamic linking to take place. You can use the Microsoft EXE File Header Utility (EXEHDR) to read the header of a module file. EXEHDR provides information about the functions that the module imports or exports. EXEHDR is included with Microsoft C Optimizing Compiler (CL); for information about how to run EXEHDR, see your C compiler documentation.
A module exports a function to make the function available to other modules. Thus, dynamic-link modules export functions for use by applications and other dynamic-link libraries. For example, the Windows dynamic-link library GDI.EXE exports all the graphics device interface (GDI) functions. Unlike dynamic-link modules, however, application modules cannot export functions for use by other applications.
A module imports a function contained in another module if it must use that function. Importing a function creates a dynamic link to the code for that function.
There are two ways to import a function into a module:
By linking the module with an import library that contains information for that function
By listing the individual function in the IMPORTS section of the module-definition file
Although both application and dynamic-link modules can import and export functions, they differ in one important respect: Unlike applications modules, dynamic-link modules are not tasks.