This is happening on Vista. I created a new dialog based MFC project
to test this. I added a CEdit control to my dialog. I called
SetLimitText to let my CEdit receive 100000 characters. I tried both:
this->m_cedit1.SetLimitText(100000);
UpdateData(FALSE);
and
static_cast<CEdit*>(GetDlgItem(IDC_EDIT1))->LimitText(100000);
I placed these calls on InitDialog.
after I paste 6000 characters into my CEdit, it becomes empty and
unresponsive. Any ideas as to what is causing this and workarounds to
be able to paste long strings of text in a CEdit or any other control?
This is happening on more than one machine. This is happening in XP also,
tough I don't know the exact amount of characters in that case.
This happens if we do not call SetLimitText at all. This happens if we use
SendMessage and EM_SETLIMITTEXT instead of calling SetLimitText.
There are no additional message handlers in the application, the only other
controls are the default Ok Cancel buttons.
In another application, this happened with 43680 characters, you could paste
43679, but the CEdit became unresponsive if you typed an additional character
after that.
43680 is 0xAAA0 in hexa, or 1010101010100000 in binary, another odd number
there.
>
>
>This is happening on Vista. I created a new dialog based MFC project
>to test this. I added a CEdit control to my dialog. I called
>SetLimitText to let my CEdit receive 100000 characters. I tried both:
>
>this->m_cedit1.SetLimitText(100000);
>UpdateData(FALSE);
****
What has UpdateData got to do with this? once you set the limit, the limit is set, and
calling UpdateData is not goiing to change anything.
You don't need to specify this->
****
>
>and
>
>static_cast<CEdit*>(GetDlgItem(IDC_EDIT1))->LimitText(100000);
****
This is a horror, and should NEVER be written!
Is it a multiline CEdit?
joe
****
>
>I placed these calls on InitDialog.
>
>after I paste 6000 characters into my CEdit, it becomes empty and
>unresponsive. Any ideas as to what is causing this and workarounds to
>be able to paste long strings of text in a CEdit or any other control?
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
On Wed, 15 Oct 2008 15:50:01 -0700, stringarray <strin...@discussions.microsoft.com>
wrote:
On Thu, 16 Oct 2008 08:10:11 -0700, stringarray <strin...@discussions.microsoft.com>
wrote: