int turn LPCTSTR

Most provincial thing, is to use CString transit at:

1
2
3
4
int  i = 10;
CString str;
str.Format(_T( "%d" ),i);
LPCTSTR  pStr =  LPCTSTR (str);

Further, the _stprintf more convenient, and automatically adapt the character set, but do need to apply a static memory and converted (as LPCTSTR mean Const constant TCHAR sub adaptation STR character string pointer).

Guess you like

Origin www.cnblogs.com/Stephen-Qin/p/12604448.html