Re: vc6.0 and vc7.0 compatibility

Tech-Archive recommends: Fix windows errors by optimizing your registry



JMiessner wrote:
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
.



Relevant Pages

  • Re: object system...
    ... [A C compiler cannot put a loop control variable in a register without ... and then later may assemble them into ... this whole API may be modified and redirected (in ... functionality it exports, but instead redirects it to the particular library ...
    (comp.object)
  • Re: Quick question about streams...?
    ... For loops and structures are the C language. ... The API is a bunch of functions. ... I don't know what "runs on assembler" means. ... A C compiler usually starts ...
    (microsoft.public.vc.language)
  • Re: How to deploy private Assemblies with VC2005 SP1
    ... deploy any program compiled with that SP1-updated compiler with private ... The app runs well on pc's which have MSVC installed. ... Of course i use the new installed SP1 ... the RTM and SP1 DLLs, so it should just work with the new DLLs. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: C Stack Corruption?
    ... and it seems that I'm getting some stack ... >corruption after any API call. ... It accepts a call from one compiler module, ... >values after any IBM API call. ...
    (comp.lang.c)
  • Re: VS2005 final delayed for september
    ... Besides, Borland isn't just relying on the compiler, but on the whole ... The dependency towards an MS OS is nowhere as tight as ... VS is the primary consumer of .Net, ... of OS API are legions in thousandths of independant companies. ...
    (borland.public.delphi.non-technical)