You must be especially careful when using the BSTR string type because it has numerous special semantics. The ATL CComBSTR class manages many of the special semantics for you and is quite useful. However, the class cannot compensate for the poor decision that, to the C++ compiler, equates the OLECHAR* and BSTR types. You always must use care when using the BSTR type because the compiler will not warn you of many pitfalls.

The CString class is poised to become the new workhorse for string processing in ATL. It is now a shared class with the MFC library and offers a host of powerful functions for manipulating strings in ways that would be very cumbersome and error prone with other string classes. Additionally, CString provides for the customization of string allocation via the IAtlStringMgr interface and a default implementation of that interface in CAtlStringMgr.

ATL Internals. Working with ATL 8
ATL Internals: Working with ATL 8 (2nd Edition)
ISBN: 0321159624
EAN: 2147483647
Year: 2004
Pages: 172 © 2008-2017.
If you may any questions please contact us: