How to CComBSTR convert to char *?
-
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
-
USES_CONVERSION;
CComBSTR *pBString;
...
...
char *pString = OLE2T(pBString);This should work.:~
The original point and click interface was a Smith & Wesson.
You're far better off with CW2A() et al (ATL7 and later). USES_CONVERSION is a biiiiiiig cludge. (Take a peek under the hood, and you'll see...)
-- Mr. Bender's Wardrobe by ROBOTANY 500
-
Do you have to use CComBSTR? If not, why are you using it?
_bstr_t
is a much more complete wrapper for BSTRs.If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Do you have to use CComBSTR? If not, why are you using it?
_bstr_t
is a much more complete wrapper for BSTRs.If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
If you want to eliminate CRT dependencies, CComBSTR is the way to go.
-- Broadcast simultaneously one year in the future