How do i load 2 different dll's in visual c++ 2010? I already loaded one, but i dont know how to load another one. I am trying to add them in the 'Environent' area listed under 'Debugging' in my project properties. plz help
-
If you are looking to use a class library, DLLs are usually loaded automatically at run time. You just need make *.h available at link time. And your *.dll files available in the build path. Maybe you could add more details in your question about what is exactly you are trying to accomplish. – mbadawi23 Feb 11 '15 at 23:44
1 Answers
That "Environment" box doesn't really control which DLLs your program loads. It's for setting environment variables: How do I set specific environment variables when debugging in Visual Studio?
You could specify the PATH variable in there, in which case that would have an effect on where DLLs are loaded from, but it still doesn't specify which DLLs to load (unless you have a very strange program which explicitly uses an environment variable setting to determine the name of a DLL to load with LoadLibrary).
If you want to load a DLL, you either need to (a) make the DLL project a dependency of your executable's project, (b) link to its stub library, or (c) call LoadLibrary(). If you want to load more than one DLL, then just do one of those things again for each DLL.