Jump to content


How to tell a program to search a dll?


  • You cannot reply to this topic
3 replies to this topic

#1 pa1

    New Member

  • Members
  • PipPip
  • 14 posts

Posted 06 March 2007 - 06:50 PM

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.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4979 posts
  • LocationBellevue, WA

Posted 06 March 2007 - 07:13 PM

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 to add an additional directory before calling LoadLibrary.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 06 March 2007 - 10:50 PM

Just explicitely load from "C:/dll_folder/dll_file1.dll" or "../dll_folder/dll_file1.dll".

#4 rouncer

    Senior Member

  • Members
  • PipPipPipPip
  • 2336 posts

Posted 07 March 2007 - 06:09 AM

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users