wchar_t*转LPCTSTR的方法:先把wchar_t*转成string,然后用MultiByteToWideChar方法把string转成wstring,最后用c_str()把wstring转成LPCTSTR。
1、wchar_t*转string
wchar_t* wch=(wchar_t*)"哇哦";
string str=(char*)wch;
2、wchar_t*转LPCTSTR
wchar_t* wch=(wchar_t*)"哇哦"; string str=(char*)wch; wstring wstr; int nLen=(int)str.length(); wstr.resize(nLen,L' '); int nResult=MultiByteToWideChar(CP_ACP, 0, (LPCSTR)str.c_str(), nLen, (LPWSTR)wstr.c_str(), nLen);
if(nResult==0)return false; LPCTSTR lpc=wstr.c_str();