C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
dll specific location Posted by dotman6 on 10 Feb 2009 at 7:05 AM
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.

Like:

Program.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
Report
Re: dll specific location Posted by richfell on 10 Feb 2009 at 3:22 PM
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:

MSDN Forums thread

Report
Re: dll specific location Posted by Lundin on 11 Feb 2009 at 4:07 AM
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.
Report
Re: dll specific location Posted by dotman6 on 11 Feb 2009 at 8:23 AM
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
Report
Re: dll specific location Posted by Lundin on 12 Feb 2009 at 12:41 AM
LoadLibrary is the function you use to open a DLL.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.