function.
Basic question is... is CString thread safe in all cases?
I've read somewhere that CString is thread safe class wise but not
instance wise. The thing is we've made sure that our CString objects
are not being accessed by more than one thread by using
synchronization objects. But we are still getting crashes with this
particular stack dump from the offending thread.
msvcr80!_vsprintf_s_l+0x7c
msvcr80!vsprintf_s+0x17
mfc80!ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> >
::FormatV+0x40
mfc80!ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> >
::Format+0x12
Its seems to be always at this point. I studied the latest dump using
WinDbg version 6.9.0003.113 and it indicated a possible heap
corruption. I tried to pursue this line of inquiry which lead me to
question the thread safety of CString. I also saw something in VC
documentation saying that a CString can be passed a heap allocator and
each thread can have its own heap manager.
Is this the correct solution? Should I create a separate heap manager/
allocator for each thread and assign them to CString so that when
CString needs to resize it won't cause any heap corruption?
Thanks a lot in advance!