2

I would like to use manifest to load c++ dll in sub directory of the exe directory. For example: the folder structure like below:

enter image description here

LoadApp depends on LoadDll, both are native c++ projects. LoadDll.dll is in the sub directory "sdk". Run LoadApp.exe, it says "Can not find the LoadDll.dll". I have embedded the sdk.manifest fie to LoadApp.exe, but seems it does not work. Here is content of sdk.manifest:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

  <file name="sdk\LoadDll.dll">
  </file>

</assembly>

I know using LoadLibrary or SetDllDirectory or Environment path can resolve the dll loading problem. But I would like to know what is wrong with manifest solution? Is it able to use manifest file for native c++ projects?

ldlchina
  • 927
  • 2
  • 12
  • 31
  • Please take a look at [this](https://stackoverflow.com/questions/3832290/altering-dll-search-path-for-static-linked-dll) and [this](https://stackoverflow.com/questions/2100973/dll-redirection-using-manifests). – Ron May 21 '18 at 15:05
  • @Ron, I tried what you linked, but both did not work. – ldlchina May 22 '18 at 01:20
  • You can add a manifest to native EXEs, and it will work for things like DPI awareness. I have no idea about this usage. – Dave S May 22 '18 at 01:47

0 Answers0