Click here to Skip to main content
15,795,791 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am having a bin folder in where my application.exe resides. My program uses, two dll with same name that has different exposed functions. I will be able to put only one dll in my bin directory. Renaming other DLL is not working. Any Suggestion on this scenario ?

You also need to rename its associated .lib file when you build your project. If these are your own .dlls, then it would be better to rebuild one of them with a completely different name. Alternatively you could use the LoadLibrary()[^] function to load one of them and handle all function calls dynamically.
Share this answer
gssajith87 25-Oct-12 13:42pm    
Thanks for the response.
Yes, I tried using LoadLibrary(). Now the problem is , when we specify the full path of the dll in the LoadLibrary Function, we get a error saying, Path Not Found. Any Suggestion on this.
Richard MacCutchan 25-Oct-12 13:43pm    
Yes, your path is incorrect, as the message tells you. Show us the actual code you use, otherwise we cannot guess what you are doing wrong.
gssajith87 25-Oct-12 13:56pm    
Here is the code :

wchar_t wbuf[PATH_MAX];
flags = 0; // Unused
to_unicode("D:\\php\\ssleay32.dl", wbuf, ARRAY_SIZE(wbuf));
return LoadLibraryW(wbuf);
Sergey Alexandrovich Kryukov 25-Oct-12 15:09pm    
There are no situations where hard-coded path names can be useful. All the path names should be calculated during run time, based on executable directory (most adequate in this case; don't mix it up with current, or working directory which can be changed by the user to anything at all), "special folder" (per user profile of for "all users"), some configuration data, etc.
Richard MacCutchan 26-Oct-12 4:00am    
Very true.
Thanks for the response. We concluded to use, static library for one and dll for the other, that had no conflict.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900