• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1167
  • Last Modified:

Convert BSTR to LPTSTR

How do I convert from BSTR that are use with ATL to LPTSTR
0
401980
Asked:
401980
  • 2
1 Solution
 
mbhaktaCommented:
If you have the VC++ or the MSDN CD handy. Search for the following topic
 Using MFC MBCS/Unicode Conversion Macros

This explains some handy macros to convert LPCTSTR -> LPCOLESTR etc.

0
 
401980Author Commented:
I'm not using MFC.
0
 
mbhaktaCommented:
BSTR is nothing but a typedef of OLECHAR. OLECHAR is nothing but a #def of  WCHAR. This is nothing but LPCTSTR if seen properly. Further down if you use the famous API , MultiByteToWideChar()the output is a LPCSTR.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now