C++中 string 型转换成 LPCTSTR型
C++中 string 型转换成 LPCTSTR型
char* string2LPCTSTR::Convert(string sFrom)
{
_TCHAR* sBuff = new _TCHAR[sFrom.length() + 2];
int iLength = 0;
iLength = wsprintf (sBuff,sFrom.c_str ());
sBuff[iLength+1] = '\0';
return sBuff;
}
char* string2LPCTSTR::Convert(string sFrom)
{
_TCHAR* sBuff = new _TCHAR[sFrom.length() + 2];
int iLength = 0;
iLength = wsprintf (sBuff,sFrom.c_str ());
sBuff[iLength+1] = '\0';
return sBuff;
}