Home
Blogs
Questions

Home

About Us

Blogs

Questions

Monetize

Post Job

banner

Questions about wchar

Read more about wchar

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - wchar

How can I convert CString to WCHAR* and std::string to WCHAR* in C++, not wchar_t*

I want to convert CString to WCHAR* or std::string to WCHAR* in Visual Studio C++ MFC Application. I found in stackoverflow that it only has the solution for convert to wchar_t*. Please help me. Thank...
test-img

Noob

c++

windows

visual-studio

mfc

wchar

Votes: 0

Answers: 2

Latest Answer

When you use CString, you could access the CW2A ATL macro,which converts CString to string. CString theCStr; std::string STDStr( CW2A( theCStr.GetString(), CP_UTF8 ) ); Or refer to this document.
test-img

Yujian Yao - MSFT

Posts

Questions

Blogs

Where knowledge meets opportunity!

About

  • Company
  • Monetize your knowledge
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved