为何用CString::Format函数无法将char*转换CString?
VC2005
Unicode
void CChat2Dlg::OnBnClickedBtnTest()
{
// TODO: 在此添加控件通知处理程序代码
char buff[]="This is test string";
CString msg;
msg=buff; MessageBox(msg);
msg.Format(TEXT("%s"),buff); MessageBox(msg);
}
上述程序两次显示的内容不一样,第一次正确,第二次是乱码。