dll specific location

I've been recently trying to learn a new API so I can send work off to companies for a placement year at uni, cos we have been using an API our lecture made and I want to stand out from other student.

My problem is when I want to send them to a company I will need to send them the .exe and all the DLLs and resources for the project, and I have a lot of Dlls and resources so I want to put them in to two folders in the same location as the .exe.


Resource Folder
Dll Folder

I know how to in code to set the directory for resources but what I don't know how to do is tell the program where to look for the DLLs because at the moment I can only get the program to run when the dlls are in the same directory as the .exe or in System32.

Its probably a really simple solution like changing something in the project settings or something but I just can't work it out so any help would be appreciated


  • Hi,

    Your question is specific to the Windows OS and not C/C++. If you post this question in a Windows specific forum you will probably get a quick answer.

    For now reading the post here may help you out:

    [link=http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/bd1c02ac-11e5-4bcd-b053-b56f2ac3ddca/]MSDN Forums thread[/link]

  • Your DLLs should only be located in the same directory as the .exe, or in a subfolder of that directory.

    If you are a fan of clogging up people's computers with junk, you could put them in system32 and yes, then it will work too.

    To open a DLL from a subfolder, simply change the path used in LoadLibrary() to something like "\subfolder\mydll.dll" and it should work.
  • Thats why I want to put them in a subfolder cos i'm sending them to companies and don't want to tell them to put them in system32, could you be a bit more specific with the LoadLibrary(), if it helps the API i'm using is SDL and i'm running on Vista 32bit and VS2008
  • LoadLibrary is the function you use to open a DLL.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!