DLLAPI (located in \TOOLKIT\SAMPLES\OS2\DLLAPI) demonstrates how to write and use a dynamic link library (DLL). The sample has a .DLL file and an executable (.EXE) file. The .DLL provides the 32-bit API function that is called by the .EXE file.

The .DLL uses protected memory on its shared data, and exception management to validate the pointer parameters for a 32-bit API function. The .EXE file demonstrates how to handle a divide-by-zero exception, and calls the function with invalid pointer parameters, followed by a call with valid pointer parameters.


[Back] [Next]