Home > Software engineering > MFC Unicode projects about ANSI string assigned to the window associated member variable problem
MFC Unicode projects about ANSI string assigned to the window associated member variable problem
Time:10-09
Don't know the title description is good,
MFC interface a CStatic control In order to use convenient associated with a value type variable Cstrings m_text;
This project USES libcurl json third-party libraries such as the output of these libraries is ANSI string (char * type or a string) So involved in the problem size bytes
The following several methods which are natural 1. Extend the third-party libraries, library returns wchar then directly assigned to m_text 2. In the assignment transformation m_text=CA2W (XXX) 3. Do not use the associated variables, instead of using SetDlgItemTextA (), so without conversion 4. I didn't think of other ways
CodePudding user response:
"" use SetDlgItemTextA (" ")
CodePudding user response:
2. In the assignment transformation m_text=CA2W (XXX)
CodePudding user response:
CA2W (XXX)
You use SetDlgItemTextA (), the accept narrow string, but what is this narrow string coding? Directly to CStatic, can display normal, not gibberish?