>> Whynot just use CComBSTR instead of _bstr_t ?
>
> maybe because _bstr_t is already in your project if you use #import? Or
that would be 500bytes extra code on your compiled project ;-)
> because it's more const-safe than CComBSTR? Or because it does simple and
> nice Unicode<>ANSI conversions?
Possibly. I never do Unicode <-> ansi conversions since I simply never
develop for Win9x/ME :).
There are very nice ATL conversion macro's that do the task already. But
since I don't know _bstr_t for sure, I cannot speak about this.
Bronek Kozicki - 25 Jul 2006 18:01 GMT
>> maybe because _bstr_t is already in your project if you use #import?
>> Or
>
> that would be 500bytes extra code on your compiled project ;-)
and yet another string class, with different ownership semantics than
others. Mistakes in ownership handling can be pretty expensive, if you
forget the semantics of class you use. Thus I simply do not use the ones
I do not really need.
>> because it's more const-safe than CComBSTR? Or because it does
>> simple and nice Unicode<>ANSI conversions?
>
> Possibly. I never do Unicode <-> ansi conversions since I simply never
> develop for Win9x/ME :).
I do use std::runtime_error (or actually my own classes derived from
thereof) and the problem is that it does not accept const wchar_t* :-(
B.