From: Octavian R. <ora...@gm...> - 2007-04-22 13:11:59
|
> From: "Jason Plum" <jp...@un...> > > >> Hi, >> >> Yes, I believe it is quite possible, as unless I am mistaken, I have had >> > 1MB loaded into a rich edit in one of my widely used programs. >> >> The easy way to test it would simply be to create it, and load in > 200KB >> of text from some file (or randomly even). >> Try creating the richtext control and and a textfield. cycle it through >> say, 256 characters at a time, upping the value in the text field. This >> would give you a visual of where it dies, if it dies. >> >> Jason >> Hi, I have already tried it, but I cannot store more than 32 KB of text in a Richedit field (using Win32::GUI::Richedit). Those 32 kb of text takes around 48 kb of rich text, but it cannot store more than that. I have tried using the Load() and Save() methods and I have also tried creating the rich text manually and storing it in the field, but it doesn't allow more than 32 kb of text. Thank you. Octavian |
From: Sean H. <jal...@ho...> - 2007-04-22 16:08:16
|
> I have already tried it, but I cannot store more than 32 KB of text in= a > Richedit field (using Win32::GUI::Richedit). > Those 32 kb of text takes around 48 kb of rich text, but it cannot sto= re > more than that. > > I have tried using the Load() and Save() methods and I have also trie= d > creating the rich text manually and storing it in the field, but it = > doesn't > allow more than 32 kb of text. Look at the Win32::GUI::RidhEdit methods GetLimittext(), SetLimitText(),= = and LimiteText(). An unfortunate misspelling on that last one; perhaps that can be fixed i= n = a future version - as of 1.05 it's still LimiteText instead of LimitText= = Of course, both names may need to be kept for several versions, so as no= t = to break any code that's using the misspelled version. Here's some more info on the text size limit: EM_LIMITTEXT Message The EM_LIMITTEXT message sets the text limit of an edit control. The tex= t = 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 contr= ol = or a rich edit control. For edit controls and Microsoft Rich Edit 1.0, bytes are used. For Rich = = Edit 2.0 and later, characters are used. Syntax To send this message, call the SendMessage function as follows. lResult = =3D = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) EM_LIMITTEXT, // message ID (WPARAM) wParam, // =3D (WPARAM) () wParam; (LPARAM) lParam // =3D 0; not used, must be zero ); = Parameters wParam Specifies the maximum number of TCHARs the user can enter. For ANSI text= , = this is the number of bytes; for Unicode text, this is the number of = characters. This number does not include the terminating null character.= Rich edit controls: If this parameter is zero, the text length is set to= = 64,000 characters. Edit controls on Windows NT/2000/XP: If this parameter is zero, the text= = length is set to 0x7FFFFFFE characters for single-line edit controls or = -1 = for multiline edit controls. Edit controls on Windows 95/98/Me: If this parameter is zero, the text = length is set to 0x7FFE characters for single-line edit controls or 0xFF= FF = for multiline edit controls. lParam This parameter is not used. Return Value This message does not return a value. Remarks The EM_LIMITTEXT message limits only the text the user can enter. It doe= s = not affect 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. If an application uses the WM_SETTEXT message to= = place more text into an edit control than is specified in the EM_LIMITTE= XT = message, the user can edit the entire contents of the edit control. Before EM_LIMITTEXT is called, the default limit for the amount of text = a = user can enter in an edit control is 32,767 characters. Edit controls on Windows NT/2000/XP: For single-line edit controls, the = = text limit is either 0x7FFFFFFE bytes or the value of the wParam = parameter, whichever is smaller. For multiline edit controls, this value= = is either -1 byte or the value of the wParam parameter, whichever is = smaller. Edit controls on Windows 95/98/Me: For single-line edit controls, the te= xt = limit is either 0x7FFE bytes or the value of the wParam parameter, = whichever is smaller. For multiline edit controls, this value is either = = 0xFFFF bytes or the value of the wParam parameter, whichever is smaller.= Rich Edit: Supported in Rich Edit 1.0 and later. Use the message = EM_EXLIMITTEXT for text length values greater than 64,000. For informati= on = about the compatibility of rich edit versions with the various system = versions, see About Rich Edit Controls. Message InformationHeader Declared in Winuser.h, include Windows.h Minimum operating systems Windows 95, Windows NT 3.1 See Also Edit Controls Overview, EM_EXLIMITTEXT, WM_SETTEXT |
From: Jason P. <jp...@un...> - 2007-04-23 12:41:17
|
Nice! Thanks for the tip on the function, and the message parameters :) I'm sure some of us will be needing this in the future. Sean Healy wrote: >> I have already tried it, but I cannot store more than 32 KB of text in a >> Richedit field (using Win32::GUI::Richedit). >> Those 32 kb of text takes around 48 kb of rich text, but it cannot store >> more than that. >> >> I have tried using the Load() and Save() methods and I have also tried >> creating the rich text manually and storing it in the field, but it >> doesn't >> allow more than 32 kb of text. >> > > Look at the Win32::GUI::RidhEdit methods GetLimittext(), SetLimitText(), > and LimiteText(). > > An unfortunate misspelling on that last one; perhaps that can be fixed in > a future version - as of 1.05 it's still LimiteText instead of LimitText > Of course, both names may need to be kept for several versions, so as not > to break any code that's using the misspelled version. > > Here's some more info on the text size limit: > > EM_LIMITTEXT Message > > 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. > > For edit controls and Microsoft Rich Edit 1.0, bytes are used. For Rich > Edit 2.0 and later, characters are used. > > Syntax > > To send this message, call the SendMessage function as follows. lResult = > SendMessage( // returns LRESULT in lResult > (HWND) hWndControl, // handle to destination control > (UINT) EM_LIMITTEXT, // message ID > (WPARAM) wParam, // = (WPARAM) () wParam; > (LPARAM) lParam // = 0; not used, must be zero > ); > > > Parameters > wParam > Specifies the maximum number of TCHARs the user can enter. For ANSI text, > this is the number of bytes; for Unicode text, this is the number of > characters. This number does not include the terminating null character. > > Rich edit controls: If this parameter is zero, the text length is set to > 64,000 characters. > > Edit controls on Windows NT/2000/XP: If this parameter is zero, the text > length is set to 0x7FFFFFFE characters for single-line edit controls or -1 > for multiline edit controls. > > Edit controls on Windows 95/98/Me: If this parameter is zero, the text > length is set to 0x7FFE characters for single-line edit controls or 0xFFFF > for multiline edit controls. > lParam > This parameter is not used. > > Return Value > This message does not return a value. > > Remarks > > The EM_LIMITTEXT message limits only the text the user can enter. It does > not affect 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. If an application uses the WM_SETTEXT message to > place more text into an edit control than is specified in the EM_LIMITTEXT > message, the user can edit the entire contents of the edit control. > > Before EM_LIMITTEXT is called, the default limit for the amount of text a > user can enter in an edit control is 32,767 characters. > > Edit controls on Windows NT/2000/XP: For single-line edit controls, the > text limit is either 0x7FFFFFFE bytes or the value of the wParam > parameter, whichever is smaller. For multiline edit controls, this value > is either -1 byte or the value of the wParam parameter, whichever is > smaller. > > Edit controls on Windows 95/98/Me: For single-line edit controls, the text > limit is either 0x7FFE bytes or the value of the wParam parameter, > whichever is smaller. For multiline edit controls, this value is either > 0xFFFF bytes or the value of the wParam parameter, whichever is smaller. > > Rich Edit: Supported in Rich Edit 1.0 and later. Use the message > EM_EXLIMITTEXT for text length values greater than 64,000. For information > about the compatibility of rich edit versions with the various system > versions, see About Rich Edit Controls. > > Message InformationHeader Declared in Winuser.h, include Windows.h > Minimum operating systems Windows 95, Windows NT 3.1 > > > See Also > Edit Controls Overview, EM_EXLIMITTEXT, WM_SETTEXT > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > > > |
From: Robert M. <rob...@us...> - 2007-04-24 19:32:10
|
On 22/04/07, Sean Healy <jal...@ho...> wrote: > > I have already tried it, but I cannot store more than 32 KB of text in a > > Richedit field (using Win32::GUI::Richedit). > > Those 32 kb of text takes around 48 kb of rich text, but it cannot store > > more than that. > > Look at the Win32::GUI::RidhEdit methods GetLimittext(), SetLimitText(), > and LimiteText(). > > An unfortunate misspelling on that last one; perhaps that can be fixed in > a future version - as of 1.05 it's still LimiteText instead of LimitText > Of course, both names may need to be kept for several versions, so as not > to break any code that's using the misspelled version. I've added it to my list of things to fix. I assume that's a French spelling ... You may also be interested in this thread from when we discussed this issue back in February: https://sourceforge.net/mailarchive/message.php?msg_id=45CD1523.2010609%40optonline.net Regards, Rob. |
From: Octavian R. <ora...@gm...> - 2007-04-23 14:26:55
|
Hi Sean, Thank you for your help. I hope I will be able to do it. Octavian ----- Original Message ----- From: "Sean Healy" <jal...@ho...> To: <per...@li...> Sent: Sunday, April 22, 2007 7:08 PM Subject: Re: [perl-win32-gui-users] Rich text field >> I have already tried it, but I cannot store more than 32 KB of text in a >> Richedit field (using Win32::GUI::Richedit). >> Those 32 kb of text takes around 48 kb of rich text, but it cannot store >> more than that. >> >> I have tried using the Load() and Save() methods and I have also tried >> creating the rich text manually and storing it in the field, but it >> doesn't >> allow more than 32 kb of text. > > Look at the Win32::GUI::RidhEdit methods GetLimittext(), SetLimitText(), > and LimiteText(). > > An unfortunate misspelling on that last one; perhaps that can be fixed in > a future version - as of 1.05 it's still LimiteText instead of LimitText > Of course, both names may need to be kept for several versions, so as not > to break any code that's using the misspelled version. > > Here's some more info on the text size limit: > > EM_LIMITTEXT Message > > 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. > > For edit controls and Microsoft Rich Edit 1.0, bytes are used. For Rich > Edit 2.0 and later, characters are used. > > Syntax > > To send this message, call the SendMessage function as follows. lResult = > SendMessage( // returns LRESULT in lResult > (HWND) hWndControl, // handle to destination control > (UINT) EM_LIMITTEXT, // message ID > (WPARAM) wParam, // = (WPARAM) () wParam; > (LPARAM) lParam // = 0; not used, must be zero > ); > > > Parameters > wParam > Specifies the maximum number of TCHARs the user can enter. For ANSI text, > this is the number of bytes; for Unicode text, this is the number of > characters. This number does not include the terminating null character. > > Rich edit controls: If this parameter is zero, the text length is set to > 64,000 characters. > > Edit controls on Windows NT/2000/XP: If this parameter is zero, the text > length is set to 0x7FFFFFFE characters for single-line edit controls or -1 > for multiline edit controls. > > Edit controls on Windows 95/98/Me: If this parameter is zero, the text > length is set to 0x7FFE characters for single-line edit controls or 0xFFFF > for multiline edit controls. > lParam > This parameter is not used. > > Return Value > This message does not return a value. > > Remarks > > The EM_LIMITTEXT message limits only the text the user can enter. It does > not affect 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. If an application uses the WM_SETTEXT message to > place more text into an edit control than is specified in the EM_LIMITTEXT > message, the user can edit the entire contents of the edit control. > > Before EM_LIMITTEXT is called, the default limit for the amount of text a > user can enter in an edit control is 32,767 characters. > > Edit controls on Windows NT/2000/XP: For single-line edit controls, the > text limit is either 0x7FFFFFFE bytes or the value of the wParam > parameter, whichever is smaller. For multiline edit controls, this value > is either -1 byte or the value of the wParam parameter, whichever is > smaller. > > Edit controls on Windows 95/98/Me: For single-line edit controls, the text > limit is either 0x7FFE bytes or the value of the wParam parameter, > whichever is smaller. For multiline edit controls, this value is either > 0xFFFF bytes or the value of the wParam parameter, whichever is smaller. > > Rich Edit: Supported in Rich Edit 1.0 and later. Use the message > EM_EXLIMITTEXT for text length values greater than 64,000. For information > about the compatibility of rich edit versions with the various system > versions, see About Rich Edit Controls. > > Message InformationHeader Declared in Winuser.h, include Windows.h > Minimum operating systems Windows 95, Windows NT 3.1 > > > See Also > Edit Controls Overview, EM_EXLIMITTEXT, WM_SETTEXT > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ |