请各位大侠帮忙怎样在编辑框里面得到汉字啊?在线等待啊^_^

解决方案 »

  1.   

    CString str;
    GetDlgItem(IDC_EDIT1)->GetWindowText(str);
      

  2.   

    首先获取编辑框RichEdit的句柄handle 在通过GetWindowText函数即可获得:handle.GetWindowText( );
      

  3.   

    感谢各位热情回复。
    我是想得到行的字符,可是我用了EM_GETLINE不能得到字符指针???还请各位大虾帮忙啊
      

  4.   

    //以下是取出所有行的字符串,输出显示 
       // The pointer to my rich edit control.
       extern CRichEditCtrl* pmyRichEditCtrl;   int i, nLineLength, nLineCount = pmyRichEditCtrl->GetLineCount();
       CString strText, strLine;   // Dump every line of text of the rich edit control.
       for (i=0;i < nLineCount;i++)
       {
          nLineLength = pmyRichEditCtrl->LineLength(i);
          pmyRichEditCtrl->GetLine(i, strText.GetBuffer(nLineLength));
          strText.ReleaseBuffer(nLineLength);      strLine.Format(TEXT("line %d: '%s'\r\n"), i, strText.GetBuffer(0));
          afxDump << strLine;
       }   //取当前行的字符串送到strText
       CSrting strText;
       nLine= pmyRichEditCtrl->LineFromChar(-1);//取得nIndex
       pmyRichEditCtrl->GetLine(i, strText.GetBuffer(nLine));
       strText.ReleaseBuffer(nLineLength);