0

I am writing an MFC program in Visual Studio 10 and I need to convert an std::string to a CString so that I can use it as a parameter for dialog controls.

I have tried every method that I can think of/find, including:

(note: all of these have an already filled std::string, named str.)

CString c = str.c_str();

CString c;
c.Format(_T("%s"),str);

CString c = (CString)str; //desperate attempt, I know....

CString c;
c.Format(L"%s", str);

Can someone help me figure out how to get this conversion done?

user3330644
  • 413
  • 1
  • 6
  • 17

0 Answers0