1. Introduce :
Dll ( Dynamic Links Library ) : is segment of softwares . A DLL file the containt code and data that can be uses by multiple programe at the same time . hence it promotes code reuse and modularization. This brief tutorial provides an overview of Windows DLL along with its usage.
2. Advantages of DLL :
2.1./. Uses fewer resources :
DLL files don’t get loaded into the RAM together with the main program; they don’t occupy space unless required. When a DLL file is needed, it is loaded and run. For example, as long as a user of Microsoft Word is editing a document, the printer DLL file is not required in RAM. If the user decides to print the document, then the Word application causes the printer DLL file to be loaded and run.
2.2./. Promotes modular architecture
A DLL helps promote developing modular programs. It helps you develop large programs that require multiple language versions or a program that requires modular architecture.
2.3./. Aid easy deployment and installation
When a function within a DLL needs an update or a fix , the deployment and installation of the DLL does not require the program to be linked with the DLL . Additionally , if multiple programs use the same DLL , then all of them get benefited from the update or the fix .
3. Important DLL Files
This is many file DLL important which shoud know for programming
- COMDLG32.DLL – Controls the dialog boxes
- GDU32.DLL – contains numerousfunctios for drawing graphics , displaying text , and managing fonts .
- KERNEL32.DLL – Contains hundreds of function for the management of memory and various proccesses.
- USER32.DLL – Contains numerous user interface function . Involved in the creation of program windowa and their interaction with each other .
4. Types of DLLs
Have two methods os links lets you call the exported DLL functions .
- Load-time dynamic linking :Application makes explicit calls to the exported DLL functions like local functions . To use load-time dynamic linking , provide a header (.h) file and import library (.lib) .
- Run-time dynamic linking , an application calls either the LoadLibrary function or the LoadLibraryEX function to load the DLL at runtime. After the DLL is successfully loaded , you use the GetProcAddress function , to abtain the address of the exported DLL function thet you want to call . When you use runtime dynamic linking , you do not need an import library file .
- List describes the application criteria for chossing between load-time dynamic linking and run time dynamic linking library Startup performance – If the initial startup performance of the application is important , you should use run-time dynamic linking .
Ease of use – In load-time dynamic linking , the exported DLL functions are like local function . It helps you call these functions easily.
Application logic – Application can branch to load different modules as required . This is important when you develop multiple – language versions
source : https://www.tutorialspoint.com