to esay understand this: An object of CEdit likes a .txt file. In the same way, an object of CRichEdit likes a .doc file.
Normally (using windows 3.1) an edit control can contain up to 64K data. That is if you haven't set the limit of the text with EM_LIMITTEXT. There are some considerations however : if you use several edit controls in one dialog box, they all take their storage from one 64K segment, so the total size of one edit control depends on the data in the other edit controls. Windows also allocates the storage from the local segment, but you can override this using a technique (which I don't know by heart) that is described in a technical article which you can find on ftp.microsoft.com or MSDN.
So,you can the sentence "// Operating system specific maximum buffer limit const AFX_DATADEF UINT CEditView::nMaxSize = 1024U*1024U-1;" in the file viewedit.cpp
实在不行,就改用CRichEdit
An object of CEdit likes a .txt file.
In the same way, an object of CRichEdit likes a .doc file.
That is if you haven't set the limit of the text with EM_LIMITTEXT. There
are some considerations however : if you use several edit controls in one
dialog box, they all take their storage from one 64K segment, so the
total size of one edit control depends on the data in the other edit
controls. Windows also allocates the storage from the local segment, but
you can override this using a technique (which I don't know by heart)
that is described in a technical article which you can find on
ftp.microsoft.com or MSDN.
const AFX_DATADEF UINT CEditView::nMaxSize = 1024U*1024U-1;" in the file viewedit.cpp
2000下int的长度是16位(两字节),所以最大容量是64k(2的16次方),
如果是CRichEditCtrl::LimitText,原型为void LimitText( long nChars = 0 );其最大容量是2的32次方(好像是几十亿的数量级),够用了吧^_^