Microsoft KB Archive/47893

From BetaArchive Wiki

MSJ DLL: Using Run-Time Linking with OS/2 DLLs

PSS ID Number: Q47893 Article last modified on 04-16-1991


Summary: The following is a summary of the program found in the “Microsoft Systems Journal” and in the Software/Data Library: Issue: May 1989, Vol. 4, No. 3, pages 51-58 Title: “Strategies for Building and Using OS/2 Run-Time Dynamic-Link Libraries” Author: Ross M. Greenberg Keyword: DLL DLL can be found in the Software/Data Library by searching on the keyword DLL, the Q number of this article, or S12266. DLL was archived using the PKware file-compression utility. This program demonstrates how you can use DLLs in your OS/2 program and have the code for the DLL loaded only when you need to access it. This saves resources when there are a number of routines in your application that are seldom used and therefore don’t need to be loaded when the application is initially loaded into the system. Also, run-time dynamic linking allows your application to take advantage of functionality provided in newer versions of OS/2 without preventing your application from running on an older version of the system that doesn’t contain the newer API calls. The following text is taken from the cover of the “Microsoft Systems Journal”: With dynamic-link libraries only one copy of any given functions needs to be in memory where it is then shared by all sessions requiring it. Run-time linking lets you load functions as you need them and, when necessary, discard them just as easily. The five function calls necessary for run-time linking are discussed.

More Information: The following are some of the programming concepts that are covered in this article: 1. Run-time dynamic linking using DosLoadModule(), DosFreeModule(), DosGetProcAddr(), DosGetModHandle(), and DosGetModName() 2. Accessing routines in a DLL by name and by ordinal number 3. Calling additional DLLs from within a DLL