Chapter 18 Creating Dynamic-Link Libraries

A “dynamic-link library” (DLL) links to the main program at run time (hence the term dynamic link). The program that calls the DLL is known as the “client program.” One DLL can supply services for several clients simultaneously.

The client program can choose to load the DLL into memory at the same time the main program loads, or it can choose to load the DLL only when it is needed.

DLLs are available only in OS/2 and Windows. In non-Windows DOS programs, all object modules are statically linked to the program at link time. This chapter discusses DLL programming for OS/2 1.x only.

After an overview of DLLs, this chapter describes the following stages in developing a DLL:

Understanding general DLL programming considerations

Writing an interface to the DLL's exported procedures and data

Writing initialization and termination code

Building the DLL

The last step requires use of a module-definition file and an import library.