In my previous message I left out a line of code.
It was in my actual test code, but not shown in the message.

procedure TForm1.Button1Click(Sender: TObject);
var
~ thrdAcc: TTestThread;
~ i: integer;
begin
~ ListBox1.AddItem(Format('Button Clicked: %d', [LoWord
(GetTickCount)]), Nil);
~ for i := 1 to 5 do
~ begin
~~~ thrdAcc := TTesthread.Create(True);
~~~ thrdAcc.FreeOnTerminate := True;
~~~ thrdAcc.id := i;
~~~ thrdAcc.OnTerminate := Self.ThreadDone;
// thrdAcc.cnn := cnn; {if testing using a local copy}
~~~ thrdAcc.Resume; // LINE ADDED
~ end;
~ Listbox1.AddItem(Format('Loop completed: %d', [Loword
(GetTickCount)]), Nil);
end;

Ian.

Reply via email to