Loading a dll from a dll?

后端 未结 4 843
情深已故
情深已故 2020-12-02 11:36

What\'s the best way for loading a dll from a dll ?

My problem is I can\'t load a dll on process_attach, and I cannot load the dll from the main program, because I d

4条回答
  •  春和景丽
    2020-12-02 12:05

    The most robust way is to link the first DLL against the import lib of the second. This way, the actual loading of the second DLL will be done by Windows itself. Sounds very trivial, but not everyone knows that DLLs can link against other DLLs. Windows can even deal with cyclic dependencies. If A.DLL loads B.DLL which needs A.DLL, the imports in B.DLL are resolved without loading A.DLL again.

提交回复
热议问题