A Windows DLL (
To create a Win32 DLL project, select the New option from the File menu, or press [Ctrl-n]. The following dialog will appear:

Choose Win32 Dynamic-Link Library from the project types list, specify the project name and the location on disk for the application. If a workspace is already open, choose whether to create a new workspace or to add this new project to the current workspace. After setting up the basic project information and pressing the OK button, another dialog will appear:

Selecting An empty DLL project will create a new project that contains no files. Now we can create new files to add to the project or insert pre-written files into the project. This is accomplished using the same steps that were described in the section on Creating a Console Application.
In order to build a DLL, a module-definition file must be added to the
project. The module-definition file, which has the file extension
;MyLibrary.def ;The following statement tells the linker to build a ;DLL called MyLibrary.dll LIBRARY "MyLibrary" ;The following line declares an exports section. EXPORTS foo baz
Comment lines begin with ;. The
To generate the DLL outputs, select the Build option
from the Build menu on the menu bar. Note that there two
significant output files created when building a DLL: a
In order for a client application to use the DLL that has been created, the following files must be supplied to the client application programmer:
The header files, the
In order to use the functions defined in the DLL, the source code in the client application should include the header file(s) copied from the DLL project. After the client project is compiled and linked, it can be executed by pressing [Ctrl-F5]. When the application is loaded by the operating system, the operating system will automatically load the necessary DLL file.
In order to debug a DLL, a client application must first be created to
exercise the functions supplied by the DLL. This is because a DLL
does not contain a
To begin debugging a DLL, first open the workspace containing the DLL project.
Select and build the debug configuration of the DLL project. When the build
is complete, copy the header files,
Saving the Output
Writing Batch Files
Back to the introduction
Copyright (C) 2000 - 2002, The University of British Columbia