Why can't convert TCHAR* to char*
问题 error C2664: 'strcpy' : cannot convert parameter 1 from 'TCHAR *' to 'char *' code: LPCTSTR name, DWORD value strcpy (&this->valueName[0], name); error C2664: 'strlen' : cannot convert parameter 1 from 'LPCTSTR' to 'const char *' LPCTSTR name; strlen (name) The code above to a class which works fine in another project, I can't find the reason why it doesn't work in this MS VS2010 Project. 回答1: You need to use a function such as wcstombs when _UNICODE is defined. Either that or just use