adding a path for dlls in vs

i'm writing a program with sdl and lua. i have 7 dlls and it looks messy in my root application directory. so, how would i have all my dlls in a different directory from the root?

1. i'm running visual studio professional 2013
2. i would rather not use LoadLibrary()
3. i would rather not change environment variables (for user friendliness)
Pretty much the only way is to use LoadLibrary(). It isn't hard at all, just be sure to use a C interface when exporting the functions.
Last edited on
Not really sure about this, but what if you use delay-load DLL's and call SetCurrentDirectory? Since the working directory is one of the locations windows searches for DLL's and since the delay-load DLL's aren't actually loaded until their exported symbols are referenced for the first time, it seems like it should do the trick.
Unless you use LoadLibrary, you cannot do that.

The reason behind this is because all DLL's are loaded BEFORE main() is called.

And, if you wanted to use LoadLibrary, follow this:
@ OP: What you want to do here requires you to add and entry for your application into the registry under "HKCU\Software\Microsoft\Windows\CurrentVersion\App Path". Here is a page telling you what needs to be done:

EDIT: Note that I am not technically cheating here, OP did not want to change the environment variables globally.
Last edited on
thanks for the answers!
Topic archived. No new replies allowed.