Dynamic Link Library
DLL Dynamic-link library (also written without the hyphen), or DLL, is Microsoft's implementation of the shared library concept in the Microsoft Windows and OS/2 operating systems. These libraries usually have the file extension DLL, OCX (for libraries containing ActiveX controls), or DRV (for legacy system drivers). The file formats for DLLs are the same as for Windows EXE files — that is, Portable Executable (PE) for 32-bit and 64-bit Windows, and New Executable (NE) for 16-bit Windows. As with EXEs, DLLs can contain code, data, and resources, in any combination.
Background All Operating-System level operations were provided by the underlying operating system: DOS. All higher level services were provided by Windows Libraries Dynamic Link Libraries. The drawing API, GDI was implemented in a DLL called GDI.EXE, the user interface in USER.EXE. The Graphics Device Interface code in GDI needed to translate drawing commands to operations on specific devices. On the display, it had to manipulate pixels in the frame buffer. When drawing to a printer, the API calls had to be transformed into requests to a printer.
Background Contd… The same architectural concept that allowed GDI to load different device drivers is that which allowed the Windows shell to load different windows programs, and for these programs to invoke API calls from the shared USER and GDI libraries. That concept was Dynamic Linking. In a conventional non-shared, static library, sections of code are simply added to the calling program when its executable is built at the linking phase; if two programs use the same routine, the code has to be included in both. With dynamic linking shared code is placed into a single, separate file.
DLL Benefits DLLs provide the standard benefits of shared libraries, such as modularity. Modularity allows changes to be made to code and data in a single self-contained DLL shared by several applications without any change to the applications themselves. Another benefit of the modularity is the use of generic interfaces for plug-ins. A single interface may be developed which allows old as well as new modules to be integrated seamlessly at run-time into pre-existing applications, without any modification to the application itself.
Features of DLL • Memory Management • Import Libraries • Symbol resolution and binding • Explicit run-time linking
Memory Management
Import Libraries
Symbol resolution and binding
Explicit run-time linking
DLL Issues • Loading issues • Portability • OS/Platform Dependency • Complexity of creating DLL’s