Ashu
Ashu

Reputation: 41

Call flow between application, DLL and Lib in windows environment

I am beginer in windows programming, and trying to understand use of DLL and lib in an existing project implementation. From my understanding LIB and dll are used to reuse the validated code and reduce the size of exe, by loading them on need basis. Although there are quite a few articles on internet explained about this, but I am looking for any example with diagram(How is the flow from Application programme to Lib/dll and vice versa). I am getting lots of error related to inappropriate setting of lib in resource and C/C++ configuration in my project, but due to my limited understanding of the calling between app-lib-dll i am unable to fix them. Looking forward for some quick refrence documents/links/video to understand these concepts.

Upvotes: 1

Views: 167

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10415

Lib files and DLL files provide ways to include code in your process. For a lib file this inclusion is done by the linker to add code to your exe. For a DLL file the inclusion is done by the operating system when your exe is loaded into memory - before the program starts. So by the time your program starts all the code is in your process memory and calling a lib function or calling a DLL function is done the same way, or almost the same way, that calls to your own functions are done. So the "flow" that you are asking about is not significantly different for a lib or DLL. A call is a call, no matter how the called function got into memory.

Upvotes: 1

Related Questions