C++ 如何使用SimpleIni返回wchar\u t,然后转换为std::wstring?

C++ 如何使用SimpleIni返回wchar\u t,然后转换为std::wstring?,c++,visual-c++,C++,Visual C++,表示支持wchar_t,但我不知道如何使用它。这就是我所尝试的: CSimpleIniCaseW ini; ini.LoadFile("myapp.ini"); std::wstring test(ini.GetValue("testsection", "testkey", "")); 错误C2664: 'CSImpleInitTempl::GetValue' :无法从转换参数1 “const char[12]”至“const wchar\u t*” 您需要将字符串指定为L“testsecti

表示支持wchar_t,但我不知道如何使用它。这就是我所尝试的:

CSimpleIniCaseW ini;
ini.LoadFile("myapp.ini");
std::wstring test(ini.GetValue("testsection", "testkey", ""));
错误C2664: 'CSImpleInitTempl::GetValue' :无法从转换参数1 “const char[12]”至“const wchar\u t*”


您需要将字符串指定为L“testsection”好的,现在我不再收到该错误,但WSString测试为空。问题在于ini文件的编码。仅当我将ini文件保存为ANSI时,它才起作用。