I want to send a long string (>60Kbyte) to an edit control by using the function
SetWindowText(...);
However, I cannot get over the default 30000 chars buffer limit in the edit
control.
I tried to send the "EM_LIMITTEXT" message to increase the limit in the edit
control, but it didn't help. The online info says the something likes this:
The EM_LIMITTEXT message limits only the text the user can enter. It has no
effect on any text already in the edit control when the message is sent, nor
does it affect the length of the text copied to the edit control by the
WM_SETTEXT message.
Any ideas?
Please reply by email (+posting optional+).
Danny@Vancouver
Right. But it also does not *extend" the amount of text that can be
entered in an "edit" control.
You're misinterpreting the intended use of EM_LIMITTEXT.
The message is used to limit the amount of text that is displayed
and/or entered in the "edit" control. For example, suppose you
provided for the user to enter a 1-4 character filename prefix:
char filenameprefix[5];
You would use EM_LIMITTEXT to set the limit to 4 so that no
more than 4 characters could be entered. If you don't do this,
you'd have to retrieve the text (which could be any length)
and truncate it yourself or let Windows do it:
GetDlgItemText(hdlg,IDD_PREFIX,filenameprefix,
sizeof(filenameprefix)-1);
EM_LIMITTEXT is a nice way to provide a bit of feedback
to your users on the length of text that can be entered.
BTW the 30k limit on all "edit" controls exists only in Windows
95 and Windows 3.x, since they share the same 16-bit GDI
kernel. There is no limit on Windows NT.
--
John A. Grant * I speak only for myself * (remove 'z' to reply)
Airborne Geophysics, Geological Survey of Canada, Ottawa
If you followup, please do NOT e-mail me a copy: I will read it here
Shaun
On Fri, 24 Jul 1998 17:34:23 -0700, Danny Lam <dl...@teloseng.com>
wrote:
>Hi,
>
>I want to send a long string (>60Kbyte) to an edit control by using the function
>SetWindowText(...);
>
>However, I cannot get over the default 30000 chars buffer limit in the edit
>control.
>
>I tried to send the "EM_LIMITTEXT" message to increase the limit in the edit
>control, but it didn't help. The online info says the something likes this:
>
>The EM_LIMITTEXT message limits only the text the user can enter. It has no
>effect on any text already in the edit control when the message is sent, nor
>does it affect the length of the text copied to the edit control by the
>WM_SETTEXT message.
>
thanks for aby pointers ;)
[ ... ]
> I want to send a long string (>60Kbyte) to an edit control by using the function
> SetWindowText(...);
>
> However, I cannot get over the default 30000 chars buffer limit in the edit
> control.
You're apparently using Lose95/98, which still use 16 bit code for
most controls. You can set the edit control to use a different block
of memory, which will allow it to hold somewhere close to 64K of text,
which _might_ be usable for your situation. However, it sounds like
you're running _very_ close to the limit, you might want to look into
alternatives.
The most obvious alternative would be to use a RichText control
instead. This has a flag to work almost like a normal edit control,
but with much greater capacity.
--
Later,
Jerry.
The Universe is a figment of its own imagination.