When do these load DLLs : Implicit Linking VS Explicit Linking

落花浮王杯 提交于 2019-12-05 08:11:53

@remy-lebeau provided a good explanation in his comment. I'll try to elaborate here as an answer.

The difference between implicit and explicit dll loading is explained here. In short:

  • In explicit loading, the application loads the dll by calling LoadLibrary explicitly.
  • In implicit loading, the application specifies the dll in compile time, and Windows loader loads it in run time.

Implicit loading has many advantages, but it slows the application loading time because all of the dlls are loaded during this stage.

To solve this issue, Microsoft supports Delayed Loaded Dlls, which is a type of implicit loading.

By using it you can enjoy all of the benefits of implicit loading, but the dll will be loaded only when your application will call one of its functions.

To your questions:

  1. In implicit loading, the dll will be loaded on application startup if you didn't specify it as delayed loaded. If you did, it will be loaded on the first usage.
  2. Yes. In all of the scenarios the dll is loaded and mapped to the application memory.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!