Default path for application and LoadLibrary
- From: "German Koninin" <nomail@xxxxxxxxxxxxx>
- Date: Wed, 7 Jun 2006 15:10:20 +0200
This is wide question, so maybe it is not about MFC but about windows
executables at all. But anyway. In my application I have delay loaded
libraries. I use several components in my application which are implemented
in separated DLLs. Before running them I need to know if they are fisically
exist in the application's folder. And if they dodn't simple don't use them.
The problem is that my application could be run with some kind of default
application path. I don't know exactly how it works, but the point is that
my application fisically exist let's say in the path "C:\Program
Files\MyApp" and if I run my program from that path by simple clicking on it
the default path will be the same. So in the code if I open a file like
CFile(_T("Myfile.txt")) and it is in the C:\Program Files\MyApp" it will be
opened just fine. But if my programm will be started with different default
path (let's say "C:\MyAppArchive") and in the code there will be
CFile(_T("Myfile.txt")) then it fails as particular file could not be found
in MyAppArchive.
But! LoadLibrary seems like working different way. It is not taking default
app path, but someway always look to the folder where my exe is placed.
So.. Some way I need to implement my file existence checker the same way.
Could you suggest me where to start digging?
Thanks!
German Koninin
.
- Follow-Ups:
- Re: Default path for application and LoadLibrary
- From: German Koninin
- Re: Default path for application and LoadLibrary
- From: xrxst32
- Re: Default path for application and LoadLibrary
- From: David Wilkinson
- Re: Default path for application and LoadLibrary
- From: Ajay Kalra
- Re: Default path for application and LoadLibrary
- Prev by Date: Re: Function Call Problem
- Next by Date: Help on retrieving Machine ID
- Previous by thread: procedure to transfer a file folder using sockets
- Next by thread: Re: Default path for application and LoadLibrary
- Index(es):
Relevant Pages
|