怎样得到CRichEditCtrl的每一行的字符数?
我是这样的:
int count = source.GetLineCount();
int nLineLength;
// source 是CRichEditCtrl对象
CString str;
for( int i= 0;i < count ; i ++)
{
nLineLength =source.LineLength(i);
source.GetLine(i, str.GetBuffer(nLineLength));
str.ReleaseBuffer(nLineLength);
}
不过每次调试,nLineLength只能得到第一行的字符数,其他的行nLineLength没有变,还是第一行的值。我不知道哪里出了错。