(Origin section: C/C
Compressed file format: text content
Attachment source: Internet
Operation mode: Windows mode
Is it verified by yourself: yes
Attachment nature: free
Specifics: Since the introduction of the first version of the Windows operating system by Microsoft Enterprise, dynamic link libraries (DLLs) have been the foundation of the operating system. All functions in WindowsAPI are included in DLL. The three main DLLs are Kernel32.dll, which includes functions for managing memory, processes, and threads; User32.dll, which includes functions for performing user interface commands such as window creation and message delivery ; GDI32.dll, which includes functions for drawing and displaying text. Windows also comes with several other DLLs that provide functions for performing some special commands. For example, AdvAPI32.dll includes functions for implementing target security, registry operations and event logging; ComDlg32.dll includes common dialog boxes (such as FileOpen and FileSave); ComCtl32.dll supports all common window controls.
This chapter will describe how to create DLLs for use by programs. Here are some factors why you should use a DLL:
1. They extend the features of the user program. Because DLLs can be dynamically loaded into the address space of a process, the user program can determine at runtime what operations are required to perform, and then load the appropriate code to perform these operations based on requirements. For example, a DLL is used when a company develops a product that other companies want to improve or enhance.
2. They can be written in many programming languages. The DLL can be written in the best language you have at hand. Perhaps your application's user interface is best written in Microsoft Visual Basic, but it's better to use C to manage its business logic. The system permits VisualBasic programs to load C DLL, CobolDLL and FortranDLL, etc.
3. They simplify software project intent management. The project is easier to manage if different working groups work on different modules in the software development process. However, the documentation that comes with the program when it is sold should be as few as possible. I know a business that sells a product with 100 DLLs by the way - up to 5 DLLs per programmer. In this way, the initialization time of the application program will be terrifyingly long, because the system must open 100 disk files before the program can perform its operations.
4. They help save memory. If two or more applications use the same DLL, the pages of the DLL only need to be put into RAM once, and all applications can share its pages. The C/C runtime library is a good example. Many applications use this library. If all application programs are linked to this static library, then the code for functions such as sprintf, strcpy, and malloc will repeatedly exist in memory. However, if all these applications are linked to the DLLC/C runtime library, then the code for these functions only needs to be put into memory once, which means that memory usage will be more efficient.
5. They contribute to the sharing of resources. DLLs can include resources such as dialog templates, strings, icons, and bitmaps. Multiple consumers can use the DLL to share these resources.
6. They help the localization of using programs. User programs often use DLLs to localize themselves. For example, a consumer program that includes only code and no user interface components can load a DLL that includes localized user interface components.
7. They help to differentiate management styles. Different versions of Windows have different functions. Developers often want to call new functions (if they exist on the host's Windows version). However, if your source code includes a call to a new function, and your application is going to run on a version of Windows that doesn't provide that function, the operating system's loader will refuse to run your process. This is the case even if you never actually call the function. If these new functions are stored in a DLL, the user program can load them on older versions of Windows. Of course, you can still call the function successfully.
8. They can be used for some special purpose. Windows makes certain features available only to DLLs. For example, certain hooks (using SetWindowsHookEx and SetWinEventHook to install) can only be installed when a certain hook notification function is included in the DLL. Windows Explorer's shell can be extended by creating COM objects that must live in DLLs. The same is true for ActiveX controls that can be loaded by a web browser and used to create rich web pages
dynamic link library.chm
.....too many files .....)