Z
zzutrain
Unregistered / Unconfirmed
GUEST, unregistred user!
我发现当sendfilethread.execute 后,线程停留,
当且仅当在sendform上移动鼠标(也就是sendform获得一个消息后)才会进入主进程。
不知道为什么?
type
TSendFileThread=class(TThread)
protected
procedure Execute;
override;
end;
var
SendForm: TSendForm;
SendFileThread:TSendFileThread;
implementation
uses FunUnit;
{$R *.dfm}
procedure TSendFileThread.Execute;
begin
SendForm.SendLedFileData;
end;
procedure TSendForm.CreateThread;
begin
SendFileThread:=TSendFileThread.Create(True);
SendFileThread.OnTerminate:= ThreadDone;
SendFileThread.FreeOnTerminate:=True;
SendFileThread.Resume;
end;
procedure TSendForm.ThreadDone(Sender: TObject);
begin
PB1.Position:=0;
PB2.Position:=0;
/////////////////////////////////////////////////////////////////////////
ListBox1.Tag:=ListBox1.Tag+1;
SendNextPc;
end;
当且仅当在sendform上移动鼠标(也就是sendform获得一个消息后)才会进入主进程。
不知道为什么?
type
TSendFileThread=class(TThread)
protected
procedure Execute;
override;
end;
var
SendForm: TSendForm;
SendFileThread:TSendFileThread;
implementation
uses FunUnit;
{$R *.dfm}
procedure TSendFileThread.Execute;
begin
SendForm.SendLedFileData;
end;
procedure TSendForm.CreateThread;
begin
SendFileThread:=TSendFileThread.Create(True);
SendFileThread.OnTerminate:= ThreadDone;
SendFileThread.FreeOnTerminate:=True;
SendFileThread.Resume;
end;
procedure TSendForm.ThreadDone(Sender: TObject);
begin
PB1.Position:=0;
PB2.Position:=0;
/////////////////////////////////////////////////////////////////////////
ListBox1.Tag:=ListBox1.Tag+1;
SendNextPc;
end;