So when you work with Windows NT services, you might want to make sure the right DLLs are loaded at the proper time. When debugging issues on NT service startup time, this becomes important. On Windows, the order of DLL loading is as follows (see also Visual C++'s help on LoadLibrary()):
- The directories listed in the App Path registry key (if any)
- The directory where the executable module for the current process is located.
- The current directory.
- The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
- The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
- The directories listed in the PATH environment variable.
to the full path of your executable, for example:
Add a sub-key named Path, set it's value to the full path of the DLL, for example:
Use regedit see examples of other applications, and how they setup their App Path keys.