I have a application developed using VC++ 6.0, I want to use some DLL's which are complied in VC++2005 (visual studio 2005), is this possible to use these dll in tat application? I can port my application to 2005 but there are few issues which need some time to fix, I want a fast release, Can anyone tell me is this possible to do this?
views:
67answers:
1It depends. If the 2005-DLL has a plain C interface it should work. If it has a C++ interface it will most probably not work.
Mixing major compiler versions can only work if you take considerate care when designing the DLL interface. The reason for this is that VS2005 uses different runtime libraries (msvcr80.dll, etc.) than VS6. You must assure that an object created by the one is not deleted by the other.
If you want to mix two major version of the runtime libraries in one application, you should only provide pure interfaces and functions to control the lifetimes of the objects defined in the DLL. With a C interface this is trivial. With a C++ interface it is possible. But it is unlikely that your DLL interface was designed with this use case in mind.