Click here to Skip to main content
15,889,335 members
Articles / Desktop Programming / MFC

C++: Converting an MFC CString to a std::string

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
1 Nov 2011CPOL 10.6K  
How about this (assuming your project is set to Unicode)?CString strMyString=L"Test string";std::string strMyStdAnsiStr = CStringA(strMyString);

Views

Daily Counts

License

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


Written By
Software Developer (Senior)
Hungary Hungary
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions