0

Scence:

One MFC program depends on msvcr90.dll and mfc90.dll,I copy those depended DLL to the program directory,program still can't execute.However,the program was executed successfully after I had installed the vcredist_x86.exe.

Miraculous is I checked the dynamic library dependencies of this program again with depends.exe,it automatically linked to dynamic library under fixed path.The path like:c:\windows\winsxs\x86_microsoft.vc90.mfc_1fc8b3b9a1e18e3b_9.0.21022.8_none_b81d038aaf540e86\MFC90.DLL,c:\windows\winsxs\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.9415_none_508df7e2bcbccb90\MSVCR90.DLL. Even, I deleted the DLL under those path and it still linked to there.

What have I installed vcredist_x86.exe,which bring about linking to dynamic library under fixed path, e.g.MFC90.DLL,MSVCR90.DLL?And why I copied don't work?

Crawl.W
  • 403
  • 5
  • 17
  • 1
    What is your question? Why the program manages to find the dlls in these obscure locations? Most likely because it has a [manifest](https://learn.microsoft.com/en-gb/cpp/build/understanding-manifest-generation-for-c-cpp-programs?view=vs-2017). – GSerg Nov 13 '18 at 08:57
  • @GSerg The manifest file is where? Can you tell me the exact basis?Thanks for the trouble. – Crawl.W Nov 13 '18 at 09:23
  • The manifest file [is inside](https://stackoverflow.com/q/420852/11683). – GSerg Nov 13 '18 at 09:29
  • @GSerg And why I copied don't work?I download 'MFC90.DLL','MSVCR90.DLL' from [https://www.dll-files.com] accurately. – Crawl.W Nov 13 '18 at 09:39
  • 1
    Because those binaries also have dependencies that weren't previously installed. – IInspectable Nov 13 '18 at 09:51
  • @IInspectable You mean dependencies under fixed path?If so,why some dll don't need to link to fixed path?If not,it should work when I copied all `dlls` to pragram directory and program should link to 'dlls' under pragram directory perferentially. – Crawl.W Nov 14 '18 at 01:40
  • Apparently, you haven't copied all required DLLs to the program directory, or copied the wrong version. When analyzing this issue, you need to ignore output gathered from Dependency Walker. It hasn't been updated in years, and completely failed to account for fundamental changes introduced in Windows 8. Enable loader snaps instead. – IInspectable Nov 14 '18 at 14:18
  • @IInspectable Sorry,loader snaps mean?Execute program directly?And is there a better tool to recommend? – Crawl.W Nov 15 '18 at 01:20
  • @IInspectable Dependency Walker hint `MFC90.DLL,MSVCR90 `missed and I copied 32-bit binaries because my program is 32-bit.Only,the version of those `dlls`,I choosed the latest version from [dll-files.com](https://www.dll-files.com/). – Crawl.W Nov 15 '18 at 01:40
  • Use the [GFlags](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/gflags) tool to [show leader snaps](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/show-loader-snaps). This requires running the application. There is no way around that to get information on the modules explicitly loaded at runtime or delay-loaded DLLs. Modules must have compatible versions. Blindly loading the latest version off of some random web page isn't going to work out. – IInspectable Nov 15 '18 at 02:30
  • @GSerg (Including IInspectable)Thanks for your help.It should be shared side-by-side assemblies to which the DLL that my application depends on should bind at run time. – Crawl.W Nov 22 '18 at 08:14

0 Answers0