Page 1 of 1

SRichViewEdit AND Thread

Posted: Wed Aug 25, 2010 8:52 pm
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?

Posted: Thu Aug 26, 2010 10:05 am
by Sergey Tkachenko
Try using Synchonize.
Or a timer instead of thread.