All Windows programs get in touch with the Windows kernel through a process often known as dynamic linking. Normally, with DOS programs, your programs are linked statically. Because of this your linker resolves all unresolved external function calls by attracting the necessary object code modules (.OBJs) to make an executable file (.EXE) made up of the executable code for those functions called in your program. The Windows environment, on the other hand, provides a lot of functions to get linked statically into one executable program. A statically linked program under Windows would probably be several megabytes in size and horribly inefficient. Instead, Windows makes extensive by using dynamic link libraries.
Dynamic link libraries (.DLLs) are somewhat just like the C libraries you create under DOS, other than DLLs can be loaded dynamically at runtime and must be linked in statically at link time. This kind of has several advantages. First, your Windows executables are typically small, counting on calls to DLLs to produce runtime support. Second, Windows can load and discard DLLs at the moment—that enables Windows to finetune its environment at runtime. Windows might make room for additional programs whether it can dynamically discard functions that are not used currently. How might dynamic linking work? It is not a fairly easy process the slightest bit. For starters, after you link your Windows program, your compiler creates a table as part of your executable file which has the dynamic link library referenced and an no. or name to display that function in this dynamic link library.
At runtime, if you reference a function call which is located in a dynamic link library, that DLL is loaded into memory, plus the function’s feeder point is retrieved out of your executable’s DLL table. When the DLL is not needed, it can be unloaded to produce room for other programs. Dynamic link libraries can be used for large programs with lots of functions. You'll be able to build a DLL with your compiler—see your compiler’s documentation for specific instructions on how to execute this task.
Dynamic link libraries (.DLLs) are somewhat just like the C libraries you create under DOS, other than DLLs can be loaded dynamically at runtime and must be linked in statically at link time. This kind of has several advantages. First, your Windows executables are typically small, counting on calls to DLLs to produce runtime support. Second, Windows can load and discard DLLs at the moment—that enables Windows to finetune its environment at runtime. Windows might make room for additional programs whether it can dynamically discard functions that are not used currently. How might dynamic linking work? It is not a fairly easy process the slightest bit. For starters, after you link your Windows program, your compiler creates a table as part of your executable file which has the dynamic link library referenced and an no. or name to display that function in this dynamic link library.
At runtime, if you reference a function call which is located in a dynamic link library, that DLL is loaded into memory, plus the function’s feeder point is retrieved out of your executable’s DLL table. When the DLL is not needed, it can be unloaded to produce room for other programs. Dynamic link libraries can be used for large programs with lots of functions. You'll be able to build a DLL with your compiler—see your compiler’s documentation for specific instructions on how to execute this task.
No comments:
Post a Comment
Thank you for your valuable comment. Stay tuned for Updates.