Prev: CMFCRibbon Menu Buttons
Next: Quries with _RecordsetPtr
From: stringarray on 15 Oct 2008 17:47 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?
From: stringarray on 15 Oct 2008 18:50 This is me again. I should note this: The exact number is 5461 characters, I can paste 5460 without problems, and when i type one more character the CEdit becomes unresponsive. this number is 0x1555 in hexa, and 1010101010101 in binary, wich i find quite odd. 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. "stringarray(a)gmail.com" wrote: > > > 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? >
From: Joseph M. Newcomer on 15 Oct 2008 21:55 See below... On Wed, 15 Oct 2008 14:47:26 -0700 (PDT), "stringarray(a)gmail.com" <stringarray(a)gmail.com> wrote: > > >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: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on 15 Oct 2008 21:56 See previous note: is it a multiline CEdit? joe On Wed, 15 Oct 2008 15:50:01 -0700, stringarray <stringarray(a)discussions.microsoft.com> wrote: >This is me again. I should note this: The exact number is 5461 characters, I >can paste 5460 without problems, and when i type one more character the CEdit >becomes unresponsive. this number is 0x1555 in hexa, and 1010101010101 in >binary, wich i find quite odd. > >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. > > > >"stringarray(a)gmail.com" wrote: > >> >> >> 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? >> Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: stringarray on 16 Oct 2008 11:10
No, it's not multiline, I would like to display everything in a single line. "Joseph M. Newcomer" wrote: > See below... > On Wed, 15 Oct 2008 14:47:26 -0700 (PDT), "stringarray(a)gmail.com" <stringarray(a)gmail.com> > wrote: > > > > > > >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: newcomer(a)flounder.com > Web: http://www.flounder.com > MVP Tips: http://www.flounder.com/mvp_tips.htm > |