C
cgs1980
Unregistered / Unconfirmed
GUEST, unregistred user!
在主线程中启动了一个子线程, 启动时设置子线程的 OnTerminate 事件为主线程中自己定义的一个处理事件,如
MainThread.StartSubThread();
begin
with TSubThread.Create(str1)do
OnTerminate := ThreadDone;
//此处如何将 str1 参数传递给 ThreadDone ?
end;
MainThread.ThreadDone(Sender: TObject;
str1:string);
begin
if str1 = 'abc' then
ShowMessage('show some thing');
end;
MainThread.StartSubThread();
begin
with TSubThread.Create(str1)do
OnTerminate := ThreadDone;
//此处如何将 str1 参数传递给 ThreadDone ?
end;
MainThread.ThreadDone(Sender: TObject;
str1:string);
begin
if str1 = 'abc' then
ShowMessage('show some thing');
end;