Help~~~
-
What's the relation of ComBStr, _bstr_t, BStr??
-
What's the relation of ComBStr, _bstr_t, BStr??
-
What's the relation of ComBStr, _bstr_t, BStr??
The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
What's the relation of ComBStr, _bstr_t, BStr??
In short: CComBSTR is a thin wrapper around the BSTR API, while _bstr_t is a rather thick one. By thick I mean that it wraps associated HRESULTs into exceptions. _bstr_t is more suitable for applications, in which it's almost always possible to throw exceptions across calls. In certain scenarios however, such as in COM components, it's not advisable to do that because of threading/apartment issues (it's downright dangerous!). In such scenarios, CComBSTR is far better suitable, as it does not throw exceptions. :)
-- Mr. Bender's Wardrobe by ROBOTANY 500
-
See this www.devguy.com/fp/Tips/COM/bstr.htm[^] Hope this will help
Thank you~~~
-
The Complete Guide to C++ Strings, Part II - String Wrapper Classes[^]
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Thank you~~
-
In short: CComBSTR is a thin wrapper around the BSTR API, while _bstr_t is a rather thick one. By thick I mean that it wraps associated HRESULTs into exceptions. _bstr_t is more suitable for applications, in which it's almost always possible to throw exceptions across calls. In certain scenarios however, such as in COM components, it's not advisable to do that because of threading/apartment issues (it's downright dangerous!). In such scenarios, CComBSTR is far better suitable, as it does not throw exceptions. :)
-- Mr. Bender's Wardrobe by ROBOTANY 500
Thank you~