2 Simple DLL Questions...

Hi, second post of the day... :)

1) How do I change a DLL from having to be in the same directory to work (after release)?
E.G. current directory: "DirWithEXE\This.dll"
new directory: "DirWithEXE\SubDir\This.dll"

2) I know it's possible to combine .NET DLLs, but is it possible to combine standard DLLs? From what I've read it's not. As it's not likely, is it possible to reduce the number of end files (DLLs) in any way?

Thanks.
ooh... and also, How do you rename a DLL after compile but so it can still be linked to the EXE?

Could someone please help me better understand this stuff, if it's possible, if so how (even if it's just part of it). Thank you.
1. Windows looks for DLLs and programs in each directory listed in the PATH environment variable if one with the name given is not found in the working directory.
2. No, but if you have access to the sources, it may be possible to recompile so that only static libraries are generated. From there, it's possible to rebuild the program to include all dependencies in itself.
3. If the program doesn't have some way of configuring that behavior (e.g. through a configuration file), or if the DLL is the dynamically loaded part of a library that was statically linked to the program, then it's not possible to rename the DLL and not break the program. It's the same as if you had to open a file:
 
std::fstream file("file");
If "file" is renamed, the program won't be able to find it.
Last edited on
Topic archived. No new replies allowed.