I am writing a DLL to connect to another (third-party) application. The DLL will need to depend on another set of DLLs (for license reasons, I cannot link statically).
I would like my DLL to be "xcopy-deployable" in any directory. I would also like not to require adding this directory to the path.
If I just create the DLL in the usual way, Windows will refuse to load the DLL because it cannot find the DLL near the current process.
Are there any good features to help Windows locate a DLL?
To answer some questions:
- The DLL is written in C ++.
- Additional DLLs are QT-dll.
- I would like to place additional DLLs in the same folder as my DLL plugin. I can get the name of this folder from
GetModuleFileName . - Application - Firefox, DLL is PKCS No. 11 Security Module.
- The application loads the DLL using the full path to the DLL (the user supplies it when installing the plugin).
- Requiring DLLs to be hosted on System32 or next to the application will work, but this is a bit messy and can cause problems with uninstallers.
LoadLibrary and GetProcAddress , of course, will work, but in my case this is not real. I use hundreds, if not thousands, of methods in other DLLs. I really need to use import libraries.
I thought about using delayed delays in combination with SetDllDirectory in DllMain. Has anyone tried something like this?
c ++ windows dll
Rasmus faber
source share