随着程序的运行,调试窗口的文字不自动往下滚,望高手指教!!!

解决方案 »

  1.   

    void CTestDlg::AppResultString(CString str)
    {
    CEdit *pEdit = (CEdit *)GetDlgItem(IDC_OUTPUT);     // Edit控件

    CString   strBuffer;    // current contents of edit control
    if (pEdit->GetLineCount() < 100 )    // 100是限制最大行数
    pEdit->GetWindowText (strBuffer);
      // Append string
      if (!strBuffer.IsEmpty())
    strBuffer += "\r\n";

    COleDateTime dt = COleDateTime::GetCurrentTime();
    CString time = dt.Format("%H:%M:%S");
    strBuffer += time;
    strBuffer += "    ";
      strBuffer += str;
    pEdit->SetWindowText (strBuffer);

      // Scroll the edit control
    pEdit->LineScroll ( pEdit->GetLineCount(), 0);
    }