void CWinsockClientDlg::OnChangeEditInf() 
{
CString   str;
m_Inf.GetWindowText(str);
str.ReleaseBuffer;
str.Right(1);
MessageBox(str,0,0);
}我想每次在文本框按键时,显示出当前的字符,可结果老不正确。example:
键入a,输出a
再键入b,则输出ab不解??

解决方案 »

  1.   

    CString   str;
    m_Inf.GetWindowText(str);
    //str.ReleaseBuffer;
    str=str.Right(1);
    MessageBox(str,0,0);
      

  2.   

    CString   str,str1;
    m_Inf.GetWindowText(str);
    str1=str.Right(1);
    MessageBox(str1,0,0);
      

  3.   

    void CWinsockClientDlg::OnChangeEditInf() 
    {
    CString   str;
    m_Inf.GetWindowText(str);
    //str.ReleaseBuffer;
    str = str.Right(1);
    MessageBox(str,0,0);
    }
      

  4.   

    CString   str;
    m_Inf.GetWindowText(str);
    MessageBox(str,0,0);
       直接这样不行?
      

  5.   

    感谢,livedeal(怀念)
    你的方法完全正确,本人刚接触MFC,还是不甚了解!谢谢你了!