The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: rags on April 19, 2006, 01:53:00 PM

Title: Edit control size limit?
Post by: rags on April 19, 2006, 01:53:00 PM
I know that the amount of text that can be entered into an edit or rich edit contol can be controlled with a
EM_LIMITTEXT message,but,Is there an upper limit as to the amount of text that can be passed to and displayed by an edit or rich edit conrol?
Regards,
Rags
Title: Re: Edit control size limit?
Post by: Ar-ras on April 19, 2006, 02:43:23 PM
If an limit is set, then 2^16 chars


If you can show more than 2^16 chars, then there is no limit (or 2^32 chars)
Title: Re: Edit control size limit?
Post by: Tedd on April 19, 2006, 03:57:39 PM
(old) Edit defaults to 16kB, but you can extend that to 64 if you forfit undo (otherwise it's 32).
Richedit doesn't appear to care what limits you give it, though I would say 2GB is a definite limit (user-space memory limit); not sure what it defaults to.
Try setting the limit to to 2GB and then try to feed it a (auto-generated) 2GB file :green2
Title: Re: Edit control size limit?
Post by: rags on April 20, 2006, 01:28:25 PM
 So if I understand correctly, setting the limit with EM_LIMITTEXT ALSO sets the limit of text the buffer can accept via a WM_SETTEXT message.
ie;
invoke SendMessage, hEdit, WM_SETTEXT,NULL,LpBuffer


Because of this:
Quote Platform SDK entry for EM_LIMITTEXT:
The EM_LIMITTEXT message sets the text limit of an edit control. The text limit is the maximum amount of text, in TCHARs, that the user can type into the edit control. You can send this message to either an edit control or a rich edit control.

I was of the understanding that the size of the text that can be displayed by the edit control had to be typed into the edit control, not passed by the WM_SETTEXT message.
Thanks for the clarification.
Rags