Creating DLL Source Files

--this file replaced with concepts/cddllsrc.htm

To build a DLL, you must first 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++.

Each function that you want to export from the DLL (that is, a function that you plan to call from other executable modules or DLLs) must be an external function|an externally visible, either by default or by being qualified with the extern keyword. Otherwise, the linker will not find your function references and will generate errors.

If your DLL and the modules that access it do not dynamically link to the same runtime DLL, you must use the pragma handler directive to ensure OS/2 exceptions are handled properly within your DLL. Use #pragma handler at the entry point of each DLL function to register the library exception handler _Exception. On exit from the function, code will also be generated to deregister _Exception.

Note: You need to explicitly register the exception handler only for the functions that will be exported from the DLL.

Dynamic Link Libraries
C Structured Exception Handling
Signals and Exceptions