Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 103075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:03:58+00:00 2026-05-11T01:03:58+00:00

This is happening on Vista. I created a new dialog based MFC project to

  • 0

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 5461 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?

note: 5461 is 0x1555 or 1010101010101 in binary, which i find quite odd.

if I paste 5460 characters I have no problems.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:03:59+00:00Added an answer on May 11, 2026 at 1:03 am

    I contacted microsof support.

    The goal was to have approximately 240000 characters in one single editable line of text.

    I am able to reproduce the issue on Windows Vista (x64 and x32 both) but not on 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's 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 I use a CRichEdit control instead, when I press ‘end’ key or ‘right arrow’ key after pasting a long string inside, i cannot see all the characters in the Rich Edit Control. trying to scroll past the last visible character produces a beep. The rest of the characters are there, I know this because if i double-click the Rich Edit Control and copy the text using ctrl-c and then paste it on a text editor, I can see the 240000 characters. So the control is holding the right amount of characters, but the last characters are not viewable except in an external editor, so my original problem remains.

    Here are the answers by microsoft representatives:

    Problem here is that an edit control with a large number of characters in it does not paint its text.

    I tried setting different characters, and discovered that I could fit more ‘l’s than ‘x’s than ‘m’s. The issue isn’t directly the number of characters, but is 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 32k pixels.

    another answer from microsoft:

    I did extensive research on this issue and would like to update you about the case progress.

    The primary difference between the Edit control on Vista and on XP is that the Edit control on Vista pre-composes its glyphs for better international support (internally, it ends up calling ExtTextOut with ETO_GLYPH_INDEX and an array of glyphs rather than a string of characters. This ends up saving the glyph indices into a metafile and so runs into the 32k pixel limit. When too many characters are provided, ExtTextOut fails and draws nothing. The Edit control on XP doesn’t precompose the glyphs and so doesn’t have this problem, but won’t handle international characters as well.

    The edit control on XP will clip at 32k, but since that is offscreen it isn’t obvious. When scrolling to the right, it starts with the first visible character so the visible part of the control is always earlier than 32k pixels.

    The RichEdit control draws the beginning, but after hitting End, edits occur mostly offscreen. RichEdit 3.0 and 4.1 gives similar behavior. This appears to be the 32k pixel limit of RichEdit control, as the it draws its text on an offscreen bitmap before displaying it to the screen.

    Considering these points, the behavior is by design. You would need to create your own control to get the behavior of displaying as big string as 240000 in a single line.

    and the last one:

    I did further research on this issue for finding any light weight workaround for overcoming 32k pixels limit, but unfortunately it seems that there is no workaround for this.

    Couple of alternatives that we tried are RichEdit 3.0, RichEdit 4.1, using UniScribe, using different fonts etc., but none of them seems to suffice your requirement.

    Possibly, you would need to create your own custom control if you wish to display an editable single-line string which exceeds 32k pixel limit in Windows Vista.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Have you looked into Radiance RGBE (.hdr) and OpenEXR (.exr).… May 11, 2026 at 11:16 am
  • added an answer I control this stuff from my .Xresources file. Personally I… May 11, 2026 at 11:16 am
  • added an answer This link provides a nice example. http://msdn.microsoft.com/en-us/library/cc148994.aspx Here is a… May 11, 2026 at 11:16 am

Related Questions

This is happening on Vista. I created a new dialog based MFC project to
So i'm not really sure why this is happening but I'm running through some
I have no idea why this is happening. I have some very straightforward code,
This is a bit of a long shot, but if anyone can figure it
This is starting to vex me. I recently decided to clear out my FTP,
This is kinda oddball, but I was poking around with the GNU assembler today
This is a difficult and open-ended question I know, but I thought I'd throw
This is my first post here and I wanted to get some input from
This is a self-explanatory question: Why does this thing bubble into my try catch's
This is an adapted version of a question from someone in my office. She's

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.