运行环境:Windows XP,VC.net,在CFormView上放了个CDialog,上面有个CEdit.

解决方案 »

  1.   

    CEdit有限制,但好象不是2K这么小。看看是不是粘贴板里的格式不对。
    实在不行,就改用CRichEdit
      

  2.   

    CEdit本来就不可以放大一点的问本啊,你可以用CRichEdit就好了。
      

  3.   

    to esay understand this:
    An object of CEdit likes a .txt file.
    In the same way, an object of CRichEdit likes a .doc file.
      

  4.   

    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.
      

  5.   

    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
      

  6.   

    不是啊,我可以用程序代码向这个CEdit中写入很长的数据,但是运行时用鼠标粘贴很短的文本都不行!
      

  7.   

    也许你的EDIT没有multiline属性。我试了一下,win2000下edit中能粘贴的内容应该是64k。
      

  8.   

    我觉得hnyyy的说法是正确的。
      

  9.   

    hnyyy(前进) 的可能性很大。
      

  10.   

    看CEdit::LimitText ,原型如下void LimitText( int nChars = 0 );
    2000下int的长度是16位(两字节),所以最大容量是64k(2的16次方),
    如果是CRichEditCtrl::LimitText,原型为void LimitText( long nChars = 0 );其最大容量是2的32次方(好像是几十亿的数量级),够用了吧^_^