两个CString相加的奇怪问题
编程环境wince6.0,程序中如下使用
CString MyFileVPN;
CString PointFile;
CString TempFile;
GetDlgItemText(IDC_EDIT4,MyFileVPN.GetBuffer(20), 20); //从编辑框中获取字符
PointFile = _T("1\\NandFlash\\1");
TempFile = PointFile + MyFileVPN;
通过监视窗口可以看到MyFileVPN为“LP2589”,但是查看TempFile却只是"1\\NandFlash\\1",这是为什么呢?高手求解
[解决办法]
这样试试
CString MyFileVPN;CString PointFile;CString TempFile;GetDlgItemText(IDC_EDIT4,MyFileVPN.GetBuffer(20), 20); //从编辑框中获取字符[color=#FF0000]MyFileVPN.ReleaseBuffer();[/color]PointFile = _T("1\\NandFlash\\1");TempFile = PointFile + MyFileVPN;