//CString转int
CString szPort = L"2589";
int nPort = _ttoi(szPort);
//CString转double
CString szPort = L"2589.00";
double nPort = _ttol(szPort);
//其它类型转CString
int nPort = 2589;
char ip[32] = "这样啊";
CString str;str.Empty();
str.Format(_T("%d:%s"), nPort, ip);
//CString转TCHAR*
CString cstr(L"hello");
TCHAR *pstr = cstr.GetBuffer(str);