String转LPCWSTR
string ACMnumberS = "4";
ACMnumberS = "MBIM + " + ACMnumberS + " ACM";
size_t size = ACMnumberS.length();
wchar_t *ACMnumberL = new wchar_t[size + 1];
MultiByteToWideChar(CP_ACP, 0, ACMnumberS.c_str(), size, ACMnumberL, size * sizeof(wchar_t));
ACMnumberL[size] = 0;
char转string
string cstr_to_string(char *p_str)
{
return p_str;
}
string转char
string strTextCharS(strTextChar);
size_t size = strTextCharS.length();
wchar_t *strTextCharL = new wchar_t[size + 1];
MultiByteToWideChar(CP_ACP, 0, strTextCharS.c_str(), size, strTextCharL, size * sizeof(wchar_t));
strTextCharL[size] = 0;