全部博文(788)
分类:
2009-04-08 09:22:44
>>如何用多线程来分别调用啊,
你从Thread继承两个线程类,在类的Execute中调用temp就可以了,
详细点啊,最好有代码啊
又遇到一位不求上进的懒人。
TMyThread = class(TThread)
private
FA: Integer;
FB: Integer;
function Temp(aa:integer; bb:integer):string;
protected
procedure Execute; override;
public
constructor Create(const AA, AB: Integer); reintroduce;
end;
constructor TMyThread.Create(const AA, AB: Integer; AE: TEdit);
begin
FreeOnTerminate := True;
inherited create(True);
FA := AA;
FB := AB;
end;
procedure TMyThread.Execute;
begin
inherited;
Temp(FA, FB);
end;
..........
procedure TForm1.Button1Click(Sender: TObject);
begin
with TMyThread.Create(100, 100) do
Resume;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
with TMyThread.Create(1000, 1000) do
Resume;
end;
这里只是一个基本框架,至于实际项目和同步显示还有许多工作要做,你自己慢慢学习吧!