Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
can any one help me .how to convert _bstr_t to char*
Posted

Googling "convert bstr to char* codeporject" returns 133,000 results. Here's one:

Guide to BSTR and C String Conversions[^]
 
Share this answer
 
Comments
Joan M 27-May-11 10:52am    
Wow! then imagine if you google for "convert bstr to char* codepROject" :-D Deserved answer! 5ed
#realJSOP 27-May-11 10:59am    
Simple misspellings canot thwart the google machine. :)
Sergey Alexandrovich Kryukov 28-May-11 0:06am    
Ha ha. A 5.
--SA
_bstr_t has defined a conversion operator for const char*. From there you should allocate a new array and copy the data if you want to turn it into a char*.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-May-11 0:06am    
Sure, a 5.
--SA
Niklas L 29-May-11 14:41pm    
Thanks.
MSDN article How to: Convert Between Various String Types. Enjoy.
Sergey Chepurin.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 28-May-11 0:05am    
Good link. I saw it already, recently. My 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900