View Full Version : How to tell a program to search a dll?
Hi. I need some help to make a program to search for a specific folder where some DLLs are needed for that program to run. For example, mi program is 'test.exe' located at C:\test.exe and it needs 'dll_file1.dll' and 'dll_file2.dll' to run, but they are in C:\dll_folder\ (I know that normally an executable searches WINDOWS or the folder where it is, but that is not what I need).
Thank you.
Reedbeta
03-06-2007, 11:13 AM
You can add additional paths by placing them in the PATH environment variable. If you are calling LoadLibrary yourself (i.e. not using an import library for the DLLs), then you can also specify the full path to the DLL when you call LoadLibrary, or you can call SetDllDirectory (http://msdn2.microsoft.com/en-us/library/ms686203.aspx) to add an additional directory before calling LoadLibrary.
Just explicitely load from "C:/dll_folder/dll_file1.dll" or "../dll_folder/dll_file1.dll".
rouncer
03-06-2007, 10:09 PM
just search in the directory for "*.dll" then put them in an array,
and loadlibrary all of them.
but your not going to know what functions are in them unless you
adopt some kind of naming convention.
or u you know how to do it a better way, that way works but
its probably a pretty messy way to do it.
vBulletin, Copyright ©2000-2010, Jelsoft Enterprises Ltd.