|
-
August 24th, 2011, 12:59 PM
#3
Re: convert CComBstr to char
 Originally Posted by Codeplug
If you know that the first character is a simple ASCII value (in the range of 0x00-0x1F), then you could simply use:
Code:
char c = static_cast<char>(*code.m_str);
gg
I don't have my crystal ball here with me (I am at work), but I am pretty sure OP doesn't just want one character from that BSTR.
The issue is that BSTR is a pointer to WCHAR, so a conversion (like W2A) is needed.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|