publicprivateprotectedvariables
asked on
tEdit and text>64KB
I have to pass a big text(~1MB) to an tMemo. Under winXP it works fine because winXp is pure 32bit code but under win98 the memo control is implemented with 16bit code, so it can only hold 64KB.
If i try to use tRichEdit, i have to wait 30sec for the 1MB text to be passed to the RichEdit1:
RichEdit1.lines.BeginUpdat e;
RichEdit1.Lines.text := one_MB_big_ansi_string;
RichEdit1.Lines.EndUpdate;
So tRichEdit is not a solution. I can't understand why tMemo in winXP(32bit code) is a lot faster than tRichEdit(also 32bit code). There must be a difference.
Any ideeas on how i could work around this?
If i try to use tRichEdit, i have to wait 30sec for the 1MB text to be passed to the RichEdit1:
RichEdit1.lines.BeginUpdat
RichEdit1.Lines.text := one_MB_big_ansi_string;
RichEdit1.Lines.EndUpdate;
So tRichEdit is not a solution. I can't understand why tMemo in winXP(32bit code) is a lot faster than tRichEdit(also 32bit code). There must be a difference.
Any ideeas on how i could work around this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can extend the (default) limit with a EM_LIMITTEXT or EM_EXLIMITTEXT message
see also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_limittext.asp
meikl ;-)
see also
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrolreference/editcontrolmessages/em_limittext.asp
meikl ;-)
In your form create func add this line :
SendMessage(RichEdit1.Hand le, EM_EXLIMITTEXT, 0, $7FFFFFFF);
SendMessage(RichEdit1.Hand
Or:
RichEdit11.MaxLength := $7FFFFFF0;
RichEdit11.MaxLength := $7FFFFFF0;
I use this code and can load in less that a second ~2MB .
not sure if is the best way. just a comment!
Have you considered using a TListbox instead? Or other components?