Modules are a fundamental structural unit in Windows. There are two types of modules: application modules and DLL 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 library modules have the same file format. This file format, which is sometimes called the “New EXE Header Format,” allows dynamic linking to take place. You can use the DOS EXEHDR utility to read the header of a module file. EXEHDR provides information about the functions that the module imports or exports.
A module exports a function in order to make the function available to other modules. Thus, DLLs export functions for use by applications and other DLLs. For example, the Windows dynamic-link library GDI.EXE exports all the graphics device interface (GDI) functions. Unlike DLLs, however, application modules cannot export functions for use by other applications.
A module imports a function contained in another module if it needs to 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's .DEF file
While both application and DLL modules can import and export functions, they differ in one important respect: unlike applications modules, DLL modules are not tasks.