P
panzichan
Unregistered / Unconfirmed
GUEST, unregistred user!
一个如何带参数的线程问题?
function co(i:integer):integer;
var
j:integer;
s:string;
begin
for j:=0 to ido
begin
s:=inttostr(j);
form1.label1.caption:=s;
form1.label1.update;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
hThread:Thandle;
ThreadIDWORD;
i:integer;
begin
i:=1000;
hthread:=createthread(nil,0,@co(i),nil,0,threadID);//该co()函数的参数i如何付给线程?
end;
[]
function co(i:integer):integer;
var
j:integer;
s:string;
begin
for j:=0 to ido
begin
s:=inttostr(j);
form1.label1.caption:=s;
form1.label1.update;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
hThread:Thandle;
ThreadIDWORD;
i:integer;
begin
i:=1000;
hthread:=createthread(nil,0,@co(i),nil,0,threadID);//该co()函数的参数i如何付给线程?
end;
[]