i've got dlls arranged this:
lib.dll
- 3rd-party dll import library link toplugin.dll
- dll linkslib.dll
, plugin designed loaded host programloadlibrary
other\plugin.dll
- plugin dll linkslib.dll
other\lib.dll
- otherplugin's copy oflib.dll
(these ordinary dlls exported functions - i'm not using com or anything.)
in test setup, if use loadlibrary
load plugin.dll
, , use loadlibrary
load other\plugin.dll
, seems both share same loaded copy of lib.dll
. need other\plugin.dll
load other\lib.dll
- don't want libraries shared.
can this? (ideally without having recompile lib.dll
.)
the technology allows called application isolation. way works having developer arrange dlls side side assemblies using manifest files.
read isolated applications on msdn official documentation.
alternatively, work without that, assuming are, in fact, loading "lib.dll" explicitly via loadlibrary
.
first, note when dll calls loadlibrary, dlls own folder not searched. if check documentation loadlibrary
on msdn see application executables folder preferred search location. first thing need call setdlldirectory
before loading plugin.dll can find own copy of "lib.dll".
next - note loadlibrary search paths used when relative path passed.
so, if first fix dlldirectory , loadlibrary "plugin.dll" call loadlibrary, passing qualified path own copy of lib.dll, plugin.dll load own version using search path, , app load own version explicitly.
Comments
Post a Comment