Create a DLL -- An Overview

  1. Create source files containing the data and/or functions that you want to include in your DLL. No special file extension is required for DLL source files. The source code can be written in C or C++.

    If you use templates, compile the template-include files located in the TEMPINC directory under the source directory. These files contain the implementation of all instantiated templates that are used in the files you compiled and are needed when you link your DLL. Copy the objects created from the template-include files into the directory containing your other DLL objects.
  2. Define which functions you want to export. Each function that you plan to call from other executable modules or DLLs must be externally visible. Otherwise, the linker will not find your function references and will generate errors.
  3. Compile and link your DLL. This can be done through the compiler, which automatically invokes the linker, or by running the compiler and linker separately.

    If you use any of the Complex, Collection, or User Interface classes, you must specify the library names on the command line. You must also specify the /Tdp compiler option.
  4. Code for initialization and termination of the DLL environment.
  5. Use the DLL.


Dynamic Link Libraries


Export Functions from a DLL
Compile and Link Your DLL in One Step
Compile and Link Your DLL in Separate Steps
Initialize and Terminate the DLL Environment
Produce a Dynamic Link Library
Use Your DLL (Windows)
Use Your DLL (OS/2)


Summary of Compiler Options