Chapter 16. DLLs

   

by Paul Gustavson

IN THIS CHAPTER

  • Creating a DLL Using C++Builder

  • Packages Versus DLLs

  • Shared Memory Support in a DLL

  • Loading a DLL

  • Using Microsoft Visual C++ DLLs with C++Builder

  • Using C++Builder DLLs with Microsoft Visual C++

Windows provides a powerful mechanism for supporting application reuse at the binary level through Dynamic Link Libraries (DLLs). A DLL typically represents a collection of common utilized functions, capabilities, and/or resources packaged into a linkable module that can be leveraged by other programs. This linkable module typically has the extension .dll .

There are many practical uses for a DLL. For instance, suppose you have a common set of math models and calculations that need to be used within several applications you develop and maintain. Rather than repetitively copying or linking the code for these models and calculations into each program, you can create and compile a single DLL that each program can load and use as if the code was already embedded within each program. This has several advantages identified as follows :

  • A DLL minimizes code re-write since it can be shared and used by multiple applications.

  • Applications will be smaller in size because the code in the DLL is isolated from the applications that use the code.

  • Applications can be updated without recompilation simply through DLL updates.

This chapter focuses on DLLs. We'll discuss how to build them and how to use them. We'll look at some of the things to watch out for when you build and use them, and we'll examine interesting DLL techniques that you can use with both C++Builder applications and Visual C++ applications.

NOTE

Within Linux, we can use something comparable to a DLL called a Data Shared Object (DSO).



   
Top


C++ Builder Developers Guide
C++Builder 5 Developers Guide
ISBN: 0672319721
EAN: 2147483647
Year: 2002
Pages: 253

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net