| Autor |
Beitrag |
Horschdware
      
Beiträge: 744
Erhaltene Danke: 54
Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
|
Verfasst: Mo 09.02.09 19:11
Hallo,
ist jemandem etwas über eine Zeichenbegrenzung im TRichEdit bekannt?
In meinem Projekt werden längere Dateien nur zum Teil geladen - der Rest wird einfach abgeschnitten.
Gibt es hier evtl Abhilfe durch eine alternative Komponente?
MfG
_________________ Delphi: XE - OS: Windows 7 Professional x64
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mo 09.02.09 19:15
Du kannst auch einfach MaxLength auf einen höheren Wert setzen. Die eingestellte 0 heißt 32768 Byte Maximalgröße, jedenfalls habe ich das gelesen.
Das Problem ist nur, dass bei sehr großen Texten alles auch entsprechend länger dauert.
|
|
Horschdware 
      
Beiträge: 744
Erhaltene Danke: 54
Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
|
Verfasst: Mo 09.02.09 19:51
Oh, das hört sich richtig gut an. Probiere ich direkt mal aus.
Das mit der Zeit ist übrigens kein Problem, es gibt schliesslich unendlich viel davon 
_________________ Delphi: XE - OS: Windows 7 Professional x64
|
|
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1
|
Verfasst: Mo 09.02.09 20:00
Ein Blick in die StdCtrls.pas und anschließend ins PSDK brachte folgende Info hervor:
| Zitat: | 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. |
[edit]Im MSDN steht es allerdings wieder etwas anders: | Zitat: |
Parameters
wParam
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
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. |
|
|
jaenicke
      
Beiträge: 19346
Erhaltene Danke: 1754
W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
|
Verfasst: Mo 09.02.09 20:07
Ja, das wollte ich gerade schreiben, ich habe es eben mit Delphi 7, Delphi 2006 unter 2000 und Vista ausprobiert. Auch mehrere 100 KiB große Dateien waren kein Problem und vollständig.
Meinst du vielleicht unter Windows 98? Und wie groß sind die Dateien denn?
|
|
Horschdware 
      
Beiträge: 744
Erhaltene Danke: 54
Win XP Pro, Win 7 Pro x64
Delphi 7, Delphi XE, C++ Builder 5, SAP R/3
|
Verfasst: Mo 09.02.09 20:16
@jaenicke
Dein erster Post hat bereits die Lösung gebracht.
Das Verändern von MaxLength hat geholfen.
PS: Problem bestand unter Delphi 5 / Delphi 6
_________________ Delphi: XE - OS: Windows 7 Professional x64
|
|
Alice
      
Beiträge: 120
|
Verfasst: Mo 09.02.09 20:38
hi,
selbst 128mbyte grosse dateien sind kein problem, dauert halt ein wenig.
cu
|
|
|