我写的程序是
void CMyTestDlg::OnChangeEdit1() 
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.

// TODO: Add your control notification handler code here
int counter=m_strEdit.GetLength();
CString str;
    GetDlgItem( IDC_EDIT1 )->GetWindowText( str ); int n=counter;
str.Format( _T("%d"), n );
    SetDlgItemText( IDC_STATIC, str );
}