Eh, I am trying to figure this out and nothing seems to work. I want to convert one simple string to unicode.
cstring doesn't work at all
PHP Code:
#include <string>
using namespace std;
....
char fileNameA[] = "D:\\sample.txt";
DWORD Pos = 10;
std::string tmpStr = "";
wchar_t* fileNameW = tmpStr.GetBufferSetLength ((Pos+1)*sizeof(wchar_t));
MultiByteToWideChar(CP_ACP, 0, fileNameA, strlen(fileNameA), fileNameW, (Pos+1)*sizeof(wchar_t));
tmpStr.ReleaseBuffer();
Code:
D:\nHide\nHide.cpp(36) : error C2039: 'GetBufferSetLength' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
D:\nHide\nHide.cpp(38) : error C2039: 'ReleaseBuffer' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'