Re: Where is my DLL?
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Oct 17, 2005
- 528 views
Juergen Luethje wrote: > > Bernie Ryan wrote: > > > Juergen: > > > > If you go to the registry and find the location of Total Commander; > > then you should be able to locate where the TC ini file is. > > From the ini file you will then know where the user's plugins > > are located. > > Yes, that should work. Also commandline parameters of Total Commander, > environment variables and more must be taken into account. On the Total > Commander forum I found a recent discussion > "Detect path to TC main settings file from plugin" > > Funny, isn't it? There it is explained how to do it. > > However, in the meantime I found another way how to get the location of > the DLL, using GetModuleFileName() (for details please see my reply to > Wolf). I think the function was made for that purpose. > > I'm sorry, I believe I forgot to mention, that the DLL not only can be > used by Total Commander, but also by any other program. Although I think > probably not many people will use the DLL with their own program, I'd > prefer a solution that does not rely on information provided by Total > Commander. > > So I'll first gather some experience with the other method. But it's > good to know an alternative way in case there will be problems. > I think the 'correct' windows behavior is to store this type of information in the "\Documents and Settings\username\Application\appname\" directory. Be careful about trying to write to the same location as the dll, because this can cause problems if the user doesn't have write permission to the directory (i.e., if they are trying to run as non-administrator). Not that a lot of apps don't already make you run as admin... Matt Lewis