customerized DLL directory?

Started by
7 comments, last by _the_phantom_ 13 years, 7 months ago
Hi guys. Just have a quick question.

Normally, we can store the DLLs in the windows/system directory or the current working directory. When the DLLs are needed, the program can find them in these directories.

My question is, is it possible to make a new directory, say called NewDir under the current working directory. And store my DLLs there?
Advertisement
Yes, it is possible.
Quote:Original post by phresnel
Yes, it is possible.


OK. You got me. How to do it, please?
One way is to add the directory to the PATH environment variable. Dynamic-Link Library Search Order
You could also link to the DLL at runtime.

The LoadLibrary function allows you to specify an absolute path.
Thanks a lot for the replies. They are surely very helpful.

It might be a stupid question, but to be specific,

If my project directory is ........\work and I want the DLL files to be stored under .........\work\DLL
I don't want the directory of the DLL files to be absolute. How do I do the above?
Quote:Original post by mylifemysoul
If my project directory is ........\work and I want the DLL files to be stored under .........\work\DLL
I don't want the directory of the DLL files to be absolute. How do I do the above?
Personally, I'd use LoadLibrary(), but it depends if the DLLs can be loaded at runtime or not. What DLLs are you referring to?
Quote:Original post by Evil Steve
Quote:Original post by mylifemysoul
If my project directory is ........\work and I want the DLL files to be stored under .........\work\DLL
I don't want the directory of the DLL files to be absolute. How do I do the above?
Personally, I'd use LoadLibrary(), but it depends if the DLLs can be loaded at runtime or not. What DLLs are you referring to?


glut32.dll; SDL.dll; zlib1.dll and probably libfreetype-6.dll later
Do NOT store your custom DLLS in the windows/system32 folder.

This is not a place you should be placing your files and programs doing so is the main cause of 'dll hell' on windows.

There are guidelines on MSDN as to where you should put dlls (I can't link to it atm as I don't have the link handy).

This topic is closed to new replies.

Advertisement