SRichViewEdit AND Thread

General TRichView support forum. Please post your questions here
Post Reply
Roman2807
Posts: 7
Joined: Tue Aug 03, 2010 7:25 pm

SRichViewEdit AND Thread

Post by Roman2807 »

In my project there are 8 forms, on the eighth SRichViewEdit. I start a stream. After stream performance hangs SRichViewEdit, and at form closing there is an error: "out of system resources"

my code

Code: Select all

......................................................................
procedure TForm8.Button9Click(Sender: TObject);
begin
 thr := tmythread1.create(true);
 thr.FreeOnTerminate := true;
 thr.Priority := tpNormal;
 thr.Start;
end;

procedure tmythread1.Execute;
var w : integer;
begin
 w := form8.linklabel2.Width;
 form8.linklabel2.Width := 0;
 form8.linklabel2.Visible := true;
  while w >  form8.linklabel2.Width do begin
    form8.linklabel2.Width := form8.linklabel2.Width + 1;
  end;
end;
I throw on other forms the button and linklabel, I write just the same code, all works normally.


In what a problem and how it to avoid?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Try using Synchonize.
Or a timer instead of thread.
Post Reply