Start an Application used DLLs from other directory.
Hi,
I have the following situation: the main executable is in a folder and some dlls - linked to the exe - are in other folder. They are needed to start the exe. Somthing like:
InstallFolder\Bin
InstallFolder\Lib
InstallFolder\Shared
The application is in "Bin", DLLs in "Lib". If I extend the system path (PATH) with "..\InstallFolder\Lib" all works perfect. The problem is: the philosophy of my company is to NOT write anything in the customer system path, registry, etc.
So: is it possible to make known the folder ..\InstallFolder\Lib to the application in "InstallFolder\Bin". E.g. you can do this if you starts an application from another (SetEnvironment) and the system path is clean. But in this case that's the application (or if needed the link) the user starts. That means the application must look not only in the current directory and in the PATH, but also in my InstallFolder\Lib.
For any idea thanks in advance.
Re: Start an Application used DLLs from other directory.
Generally application DLLs are placed in either application' current directory or in one of standard directories (which are part of %PATH% ).
In case you absulutely need this, other than appending one more string to PATH variable, you can try dynamic loading of your DLL. For this you need to call LoadLibrary, and pass absolute or relative path of DLL location.
Dynamic loading has its own implications. It should be used only when specific functionality is needed at later time of execution. For instance backup program or a game utility within your application.
Re: Start an Application used DLLs from other directory.
I believe it might be cheated with special launcher application. It will run and first modify its own environment and then start main app which inherits parent's modified environment.
I'd like to say that the philosophy of your company should obey to common rules - either in aspect of module placing or in aspect of environvent adjustment. Breaking all rules would be painful too much.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.