I contacted micro-content.
The goal was to have 240,000 characters in a single editable line of text.
I can reproduce the problem of Windows Vista (x64 and x32 both), but not in Windows XP.
this code works fine in XP:
BOOL ClongeditXPDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here UINT limit = m_longEdit.GetLimitText(); m_longEdit.SetLimitText(240000); UINT limit2 = m_longEdit.GetLimitText(); CString str; str = _T(""); for(int i = 0; i < 250000; i++) str += _T("a"); m_longEdit.SetWindowText(str); return TRUE; // return TRUE unless you set the focus to a control }
If instead I use CRichEdit when I press the "end" or "right arrow" key after pasting a long line inside, I cannot see all the characters in Rich Edit Control. an attempt to scroll through the last visible character produces a beep. The rest of the characters are there, I know this because if I double-click Rich Change the control and copy the text using ctrl-c, and then paste it into the text editor, I see 240,000 characters. Thus, the control keeps the correct number of characters, but the last characters are inaccessible for viewing except by an external editor, so my original problem remains.
Here are the answers from Microsoft Representatives:
The problem is that the edit control with a lot of characters in it does not draw text.
I tried setting different characters and found that I could fit more 'l than' x than 'm'. The problem is not the direct number of characters, but most likely the number of pixels. Multiplying the number of visible characters by the pixel width of the characters in the selected font shows that the limit is about 32 thousand pixels.
another answer from Microsoft:
I have done extensive research on this issue and would like to inform you about the progress.
The main difference between Change Management in Vista and XP is that the Edit control in Vista pre-compiles its glyphs for better international support (internally, it ends with calling ExtTextOut using ETO_GLYPH_INDEX and an array of glyphs rather than a character string. This results in saving the glyph indices in the metafile and thus 32k pixels. When too many characters are provided, ExtTextOut fails and draws nothing. Edit control over XP does not precede glyphs and therefore does not have this problem, but will not process intern odnye characters.
The XP editing control will be 32k, but since it is off-screen, it is not obvious. When scrolling to correctly, the visible character begins with the first, so the visible part of the control is always earlier than 32 thousand pixels.
The RichEdit control draws starting, but after hitting End, editing happens mostly off-screen. RichEdit 3.0 and 4.1 give similar behavior. This seems to be a 32k pixel RichEdit control limit, as it draws its text on the screen bitmap before displaying the screen.
Given these points, design behavior. You will need to create your own control in order to get the behavior of displaying a large line as 240000 in one line.
And last:
I continued research on this issue to find a light weight workaround to overcome 32k pixels but, unfortunately, it seems that there is no workaround for this.
A couple of alternatives that we tried RichEdit 3.0, RichEdit 4.1, using UniScribe, using different fonts, etc., But none of them seem to be enough of your requirement.
You may need to create your own controls if you want to display an editable single-line line that exceeds the 32k pixel limit in Windows Vista.