Re: Problem with reading an int with operator>>



I don't see this _BUILD preprocessor symbol in the Standard Library
files for VC6 or VC7. Is this a VC8 thing?

As you say, Pete Becker is the expert. But what I mean is: Suppose my
application consists of a .exe and one or more DLL's. Then if I want to
pass std::string objects between two modules, then both these modules
had better be using the same heap. If either is statically linked to
CRT, they won't be. So you are forced to either NOT pass std::string
objects across the boundary (my choice) or link everything dynamically
to CRT.

All correct so far.
You can pass std::string and not use CRT in DLL form but it is effectively
read-only.
And it is not just the heap, it is any static data that the C or C++
libraries use.
So fopen() in an EXE and fclose() in a DLL may cause problems.

In the latter case, I think I have to use (and ship) msvcp60.dll
(or later version), though I'm not sure why. I just don't see why this
is necessary. If my two modules are using the same CRT heap anyway, why
do I need msvcp60.dll ?

msvcp60.dll is the C++ RTL functions, _NOT_ the C RTL functions in DLL form.
If you statically link, I am not sure you should get this dependency.

Stephen Howe


.



Relevant Pages

  • Re: Problem with reading an int with operator>>
    ... Stephen Howe wrote: ... CRT, they won't be. ... You can pass std::string and not use CRT in DLL form but it is effectively ... And it is not just the heap, it is any static data that the C or C++ ...
    (microsoft.public.vc.stl)
  • Re: CoCreateInstance Crash
    ... CoTaskMemAlloc/Free do not use the same heap as the CRT. ... OLE DLL loads. ... >> to allocate memory for return arguments via CoTaskMemAlloc ...
    (microsoft.public.vc.atl)
  • Re: heap shared with DLL
    ... existing CRT implementations. ... heap manger (not the EXE or DLL) maintains alloc/free states of blocks. ... heaps are identified by heap handle. ... Let's say your EXE is linked to MS CRT ...
    (microsoft.public.windowsce.embedded)
  • Re: Heapmanagement VS 2003 Runtime
    ... Dort wurden ja auch Vergleichstests gefahren, wo die Memoryfunktionen der VS 2003 CRT dermaßen schlecht abschnitten, dass mir richtig angst wird. ... Der Heap kann natürlich immer noch verbessert werden, da stimm ich dem Artikel vollkommen zu... ... Ich hoffe wir bekommen bald die Testversion. ...
    (microsoft.public.de.vc)
  • Re: Heapmanagement VS 2003 Runtime
    ... Dort wurden ja auch Vergleichstests gefahren, wo die Memoryfunktionen der VS 2003 CRT dermaßen schlecht abschnitten, dass mir richtig angst wird. ... Die Runtime von VS 2005 scheint deutlich besser zu sein, so dass ich mich frage, welcher dämlichen Algo. ... Der Heap kann natürlich immer noch verbessert werden, da stimm ich dem Artikel vollkommen zu... ...
    (microsoft.public.de.vc)