I plan to upgrade my VS 2003 to VS 2008, but am worried about compatibility across the two versions. In particular, I have a third party application that is compiled in 2003 (this cannot be changed) and am developing extensions as DLLs for this application. So my question is whether a DLL compiled with Visual C++ 2008 can be called without problems from an application compiled with 2003. Does this work?
Apart from binary compatibility, I'm mainly worried about the fact that I would end up with two different runtime libraries (the 2003 from the application and the 2008 from my DLLs). Is this a problem?
In general, there is no binary compatibility between modules complied with different versions of VC. It will most certainly fail if you exchange library objects (C++ standard library, MFC...) across the boundary.
Having two versions of the CRT is not necessarily fatal, but it will be if the modules exchange memory across the boundary.
If the DLL is a COM DLL it will work, because the COM interface is designed for binary compatibility, independent of the compiler.David Wilkinson | Visual C++ MVP
Marked As Answer byRong-Chun ZhangThursday, April 09, 2009 11:28 AM
What about on 64-bit Windows? On Windows XP SP3, we have a case where a 32-bit Visual Studio 2008 SP1 C++ native application succesfully uses a 32-bit COM dll that is built with Visual Studio 2003 SP1. On 64-bit Windows Vista SP1 or Windows 7, this same scenario crashes.
Is this binary compatibility through COM supported on WOW64?
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.