cannot convert from 'WCHAR [260]' to 'std::basic_string<_Elem,_Traits,_Ax>'

error C2440: 'initializing' : cannot convert from 'WCHAR [260]' to 'std::basic_string<_Elem,_Traits,_Ax>'

解决方法:这是由项目使用的字符编码所至的问题,使用unicode时,LPSTR p = str.getBuffer(len + 1)便会出现这个错误,解决方法是将Project Properties中的Configureation Properties->General->Character Set = Not Set,重新编译即可

你可能感兴趣的:(cannot convert from 'WCHAR [260]' to 'std::basic_string<_Elem,_Traits,_Ax>')