Dean Seo
Dean Seo

Reputation: 5683

How to impose dll files in the current directory?

This application uses msado15.dll, msvcr100.dll and many dlls.

I found out that the application does NOT load msado15.dll and msvcr100.dll files in the current directory using ProcessExplorer and DependencyWalker.

Rather, this application loads the dlls from the winsxs folder or different Windows system directories.

I'd like to prevent it from loading dlls in "not current directory" even if it works fine without the dlls that I've copied.

How can I fix this? Any help would be appreciated.

Thanks in advance!

Upvotes: 2

Views: 2694

Answers (2)

Suhas
Suhas

Reputation: 63

Place a copy of those DLLs(msado15.dll, msvcr100.dll) in the directory containing your exe. Loader will first try to load DLLs from directory containing your exe.

Below is the order in which windows loader searches for DLLs: [Reference: Windows via C-C++ by Jeffrey Richter]

  1. The directory containing the executable file
  2. The Windows system directory returned by GetWindowsDirectory
  3. The 16-bit system directory—that is, the System subfolder under the Windows directory
  4. The Windows directory returned by GetSystemDirectory
  5. The process' current directory
  6. The directories listed in the PATH environment variable

Upvotes: 0

VoidStar
VoidStar

Reputation: 571

I did some research and it's actually pretty easy. According to this article, all you have to do is create an empty file named (YourAppName).local. This will tell windows to look in the exe folder instead of using the shared components.

Upvotes: 3

Related Questions