1、将CString(unicode)转换为char*(ANSI)CString strServIP; pChat->GetDlgItemText(IDC_IP,strServIP); char strAddr[] = {}; USES_CONVERSION; strcpy_s(strAddr,,T2A(strServIP));