Re: How to set up search path in MFC?



Note that app paths only works for processes launched via ShellExecute, not CreateProcess,
so there is a certain risk in depending upon its behavior.
joe

On Fri, 11 Aug 2006 20:29:02 -0400, "Pete Delgado" <Pete@xxxxxxxxx> wrote:


"kathy" <yqin_99@xxxxxxxxx> wrote in message
news:1155306635.879119.312160@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Under my application folder, there is folder called Driver which has
xxx.dll in it.

c:\application\Driver

My application run in application folder.

How to setup the search path in my application so that it can find the
xxx.dll in Driver folder?


There are several things that you can do. However, the best/easiest is to
create an app_paths entry for your executable on the system with the
installation program for your product. In this manner, the installation of
your application will not negatively affect other programs installed on the
system as is possible if you modify the global or user path.

Another good option is to use side-by-side DLLs which are described in the
MSDN documentation. Take a look for the article entitled "The End of DLL
Hell".

Another option that others have stated here is to modify the global or user
path environment variable. This is usually not recommended because it
alters the environment in which all applications run and can lead to
dependancy issues.

Lastly, you can modify your application to use explicit runtime linkage.
This is usually not recommended for the general case that you describe, but
it can be useful in certain circumstances.

-Pete

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.