A compilation error is found when you use ATL to implement a COM:
'Bad _ alloc ': is not a member of 'stlp _ STD'
Remove allCodeFind the problematic code line.
The last line of code can be used to reproduce the error:
# Include <New> // for STD: bad_alloc
...
Throw STD: bad_alloc ();
There is no error in disabling the stlport library and using the native STL library of vc6, but there is a warning:
Warning c4530: C ++ exception handler used, but unwind semantics are not enabled. Specify-GX
The problem seems to be that the GX compilation switch is enabled.
By default, ATL does not enable exception handling, but STL must be used.
It seems that ATL does not encourage the use of STL, or even less CRT, in order to generate the smallest target module.
Refer:
[1] using STL in ATL
[2] issues with using STL classes in ATL COM
(Reprinted pleaseSourceJinqing column)