Page 1 of 1

Copy to clipboard without crash

Posted: Wed Jun 21, 2006 9:03 pm
by christopher00
Anyone know of a way to use the TRichViewEdit and copy data to the clipboard without the application crashing if the data in the TRichViewEdit is quite large? Windows Notepad can handle copying text within seconds after clicking Edit-Copy, or Ctrl+C, whereas if you have a large amount of data (i've tried just text) in the TRichViewEdit and do Ctrl+C (or use the Copy procedure), the application with the TRichViewEdit crashes.

Ideas?

Posted: Thu Jun 22, 2006 3:48 pm
by Sergey Tkachenko
Does it really crash? It just may take very long time.
It's because a standard TMemoryStream is used. TMemoryStream is unefficient when writing a large amount of data, because many memory reallocations occur.
In the next update, TRichView will use another stream class, with larger memory delta. Copying will be much faster.

Posted: Sun Jun 25, 2006 2:28 am
by shmp
Just to confirm. Have been using ctrl-c, ctrl-x and ctrl-v for a very long time and never faced a crash. It may have been very sloooooow because some other applications are running in the background or the file is just tooooo big. :D

Good luck.

Posted: Tue Jun 27, 2006 6:43 pm
by Sergey Tkachenko
Copying may be really very slow if document contains multimegabyte text.
In the current version, it can be improved only by modifying VCL source (changing MemoryDelta from Classes.pas to lager value (power of 2)). In the next update, this problem will be fixed without modifying VCL source.