Do not use on any
shared computer
September 7, 2008 05:32am pdt
 
[x]
Attachment Details

How to set VS 2008 DLL path

Tags: Visual C++
I want to know how to point VS 2008 (or 2005) to a custom DLL path:  
1. I create a DLL (my.dll) for common symbols, helper functions.
2. I put the dll in C:\mydlls and add that path to the system PATH variable.
3. I create an application to use that dll.  It launches fine when OUTSIDE of VS (i.e. exe is double-clicked).  
4. It fails to launch when I hit 'Start Debugging' OR 'Start Without Debugging' in VS 2008 with the error 'failed to start because my.dll was not found...'.
5. I added the dll path to the VC++ Directories (I tried Executable, Include, Library, Reference, Source) under Tools | Options and it did NOT fix the problem.
6. One way to fix it is to put the dll in c:\windows\system32.

So I need to know how I can modify the DLL path for Visual Studio.  It obviously has 'c:\windows\system32' in there already... how/can I add 'c:\mydlls'.  I would rather keep them in 1 directory rather than have multiple versions, etc.  I do NOT want to have to copy it into the Debug/Release folder of the app I'm working on, that is just dumb.

BTW I am loading the DLL implicitly, NOT explicitly using LoadLibrary.  I use the functions throughout the code so I think this is best (rather than a one and done scenario).
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Programming
Question Asked By: pmartino99
Solution Provided By: pmartino99
Participating Experts: 2
Solution Grade: A
Views: 104
Translate:
Loading Advertisement...
 
[+][-]Expert Comment by evilrix

Rank: Master

Expert Comment by evilrix:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by jaime_olivares

Rank: Guru

Expert Comment by jaime_olivares:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by pmartino99
Author Comment by pmartino99:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Expert Comment by evilrix

Rank: Master

Expert Comment by evilrix:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Accepted Solution by pmartino99
Accepted Solution by pmartino99:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628