DLL depends another DLL but windows can't find it

I am working on an application where users can develop their own plugins as dll files. They need to put these dll files to a specific path so my application(C++) can load them and run. The problem is, when user develops a dll file depends another dll file and put both files to my dll path, my application can't find second dll file.

Ex:

DllA(C++) depends DllB(C#) my app loads DllA but can't find DllB and fails.

If user puts DllB into application binary path and DllA to specific dll path, I am able to execute plugin. I also tried to put DllB into various directories such as windows or system32 but it again fails. I also tried to add my dll path to PATH environment variable but no effect.

I am already executing SetDLLDirectory function to load DllA in the specific path. Since I've no control over user code, I can't make them to call this function in DllA code also. My question is that how can I force windows to search my specific dll path?

链接地址: http://www.djcxy.com/p/7752.html

上一篇: 如何设置单声道dllimport的搜索路径?

下一篇: DLL依赖于另一个DLL,但Windows无法找到它