vc6.0 and vc7.0 compatibility

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We write a plug-in (DLLs) for an application. The latest release of the
application uses the vc7.0 compiler. Previous releases used the vc6.0
compiler. So I must upgrade our plug-in. Problem is our plug-in depends on
third-party DLLs compiled and linked with vc6.0; we don't have vc7.0
versions. My plug-in compiles and links correctly with vc7.0 but does not run
correctly.

Question is: are vc6.0 DLLs incompatible with a vc7.0 application/DLL?
 
JMiessner said:
We write a plug-in (DLLs) for an application. The latest release of the
application uses the vc7.0 compiler. Previous releases used the vc6.0
compiler. So I must upgrade our plug-in. Problem is our plug-in depends on
third-party DLLs compiled and linked with vc6.0; we don't have vc7.0
versions. My plug-in compiles and links correctly with vc7.0 but does not run
correctly.

Question is: are vc6.0 DLLs incompatible with a vc7.0 application/DLL?
The general answer is "no". The more specific answer is that you can
only ensure compatibility if you adhere to rules isolating dependencies
across the dll boundary. There are 2 common ways to ensure that isolation:
1) Use COM. The rules of COM are guaranteed to provide the required
level of isolation.
2) Define an API layer that does not pass any CRT/ATL/MFC/third party
types across the boundary and that does not allocate memory and release
it on different sides. E.g. the Win32 API is one that follows these
guidelines. It is extremely hard to do this iwth a C++ API, it is
feasable to do this with a flat C API.

Ronald Laeremans
Visual C++ team
 
Back
Top