You are having application problems because the path does not seem to work.
Microsoft has offered a solution to all these problems. An application can now store it own path in the registry under the following key:
The use the application path, set a key for your application, using testapp.EXE from the example above:
Set the (Default) value 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:
With an App Path registry entry, the system will load DLLs in the following order.
1. The directories listed in the App Path registry key
2. The directory where the executable module for the current process is located.
3. The current directory.
4. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
5. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
6. The directories listed in the PATH environment variable.
About the Author
Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.