Hi,

I'm building this dynamic link library and it's compiled with "Code
Generation" option set to "Multithreaded DLL". It's designed to be linked by
another DLL or EXE. From what I understand, I can't use "Multitheaded" here
because multiple "static" copies of CRT running in the same process space
can cause problems. (And If I set it to "Multithreaded", my program will
crash in very weird parts.) So I stick to "Multithreaded DLL", and
everything goes fine.

The problem is that since the DLL is generated by VS.NET 2003, it has
dependency on MSVCR71.DLL and MSVCP71.DLL. I know I can ship these two files
with my software package. But what if I don't want to do so? Can I
dynamically link to the "latest available CRT" on users' computer? Can I
link to an older version such as MSVCR60.DLL and MSVCP60.DLL? Is there any
compiler option to force linking an older library?


Thanks in advance,
--
He Shiming

Re: Eliminating msvcr71.dll & msvcp71.dll dependency by Jochen

Jochen
Wed Apr 20 04:55:58 CDT 2005

Hi He!
> I'm building this dynamic link library and it's compiled with "Code
> Generation" option set to "Multithreaded DLL". It's designed to be linked by
> another DLL or EXE. From what I understand, I can't use "Multitheaded" here
> because multiple "static" copies of CRT running in the same process space
> can cause problems. (And If I set it to "Multithreaded", my program will
> crash in very weird parts.) So I stick to "Multithreaded DLL", and
> everything goes fine.

Where have you read this?
In general you can say: It is a bad design if memory is allocated in one
DLL/EXE and freed in an other.
If this is not the case, then you can use whatever you want (I prefer
static CRT).

> The problem is that since the DLL is generated by VS.NET 2003, it has
> dependency on MSVCR71.DLL and MSVCP71.DLL.

Yes.

> I know I can ship these two files
> with my software package. But what if I don't want to do so?

YOu have a problem (your app /dll does not start).

> Can I dynamically link to the "latest available CRT" on users' computer?

No.

> Can I link to an older version such as MSVCR60.DLL and MSVCP60.DLL?

Maybe you can do this if you replace the inc/lib files for CRT with the
old one.

> Is there any compiler option to force linking an older library?

No (see above).

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/