Re: Allocate and De-allocate in Multi-DLL Program
"Norman Bullen" <norm@BlackKittenAssociates.com> ha scritto nel messaggio
news:pr2dnaKqtIV5abHVnZ2dnUVZ_tninZ2d@earthlink.com...
Some thought and experimentation has persuaded me that, if an object has a
virtual destructor and both constructor and destructor are inline, delete
will call the destructor in the same module that constucted the object,
regardless of where the delete is. Can anyone find ground to disagree with
that?
I tend to not have inline constructors and destructors, but it's more a
matter of personal style and preference (IIRC, I had some problems with
inline virtual destructors in VC6, but I'm not sure about that - it was some
years ago). However, I would just do some testing... Computer science tends
to be an experimental science.
Alternatively, I could link the programs and all of the DLLs with the DLL
run-time libraries. This would result, if I understand correctly, in a
single heap being used across the entire program. My concern stems from
the fact that I'm still using VC 6.0. Can I still count on DLL libraries
that are compatible with VC 6.0 being installed on every Windows machine?
I think that if you build all the EXE and DLLs with the *same* compiler, and
link with the *same* version of CRT (e.g. release multithreaded DLL), you
will have no problem.
And I believe that VC6 runtime is installed with Windows XP.
(I think that msvcrt.dll is a system component in these days...).
HTH,
Giovanni