Click here to Skip to main content
15,893,663 members
Articles / Desktop Programming / MFC

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

Rate me:
Please Sign up or sign in to vote.
4.78/5 (2 votes)
13 Nov 2011CPOL 14.2K  
I am using CString str(_T("Test"));typedef std::basic_string string_t;string_t resStr(str);It works because the CSting has a cast to LPTCSTR.

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 Verizon Internet Services
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions