void CSerialPortDlg::OnTimer(UINT nIDEvent)
{
if(Receive)
{
if(strInChar.GetLength()!=0)
{
m_strReceive+=strInChar;
strInChar=_T("");
SetDlgItemText(IDC_RECEIVE,m_strReceive);
m_CtrlReceive.SetSel(m_strReceive.GetLength(),m_strReceive.GetLength(),FALSE);
}
}
CDialog::OnTimer(nIDEvent);
}
这段代码,用到strInChar了,你把m_strReceive+=strInChar; 改成m_strReceive=strInChar; 就可以了。