cannot convert from 'WCHAR [260]' to 'std::basic_string'

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,重新編譯即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章