MSVCR71.DLL with VC 7.0 ?

G

Guest

Hi,

we are writing a program which uses some third party APIs librares.
Those APIs are dinamically linked to the MSVCR71.DLL.

Unfortunately, we are compiling with the C++ DOT NET 7, which uses
the MSVCR70.DLL.
This means, that we are able to compile, but when in our code we try
to call some function of the MSVCR7x.DLL, the program crashes.

Probably because at runtime sometime the functions in the MSVCR70.DLL are
called, and sometimes the ones in MSVCR71.DLL (causing some confusion in the
heap ? ).

We tryed to statically link the MSVCR70.DLL, but the program crashes however
:-(

The function that crashes is:
fprintf( pStream, ("%s %s\r\n"), pszKey, pszValue );

If we call it with just 3 arguments it works fine:
fprintf( pStream, "%s", pszKey );

In the past we already had some kind of this problem
(unpredictable behaviour and crashes).
We were using the VC 6 and the third party APIs used the MFC 7.
We solved the problem moving to the VC 7 (= DOT NET 1).
But this time we can not move to a newer DOT NET . :-(

Is there some way to avoid this runtime confusion when calling library
functions which are defined in different version of DLLs ?

Any sugguestion would be really appreciated.

saluti !
 
C

Carl Daniel [VC++ MVP]

Fabuio said:
Hi,

we are writing a program which uses some third party APIs librares.
Those APIs are dinamically linked to the MSVCR71.DLL.

Unfortunately, we are compiling with the C++ DOT NET 7, which uses
the MSVCR70.DLL.
This means, that we are able to compile, but when in our code we try
to call some function of the MSVCR7x.DLL, the program crashes.

Probably because at runtime sometime the functions in the MSVCR70.DLL
are called, and sometimes the ones in MSVCR71.DLL (causing some
confusion in the heap ? ).

We tryed to statically link the MSVCR70.DLL, but the program crashes
however :-(

The function that crashes is:
fprintf( pStream, ("%s %s\r\n"), pszKey, pszValue );

If we call it with just 3 arguments it works fine:
fprintf( pStream, "%s", pszKey );

In the past we already had some kind of this problem
(unpredictable behaviour and crashes).
We were using the VC 6 and the third party APIs used the MFC 7.
We solved the problem moving to the VC 7 (= DOT NET 1).
But this time we can not move to a newer DOT NET . :-(

Is there some way to avoid this runtime confusion when calling library
functions which are defined in different version of DLLs ?

In a nutshell - no. If you're linking with static libraries compiled with
VC7.1, then you need to be building with VC7.1. There probably are some
corner cases that could be made to work, but in general it's not going to
happen.

I'd suggest contacting the 3rd party and requesting libraries for VC7.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top