G
GuestUser
Unregistered / Unconfirmed
GUEST, unregistred user!
unit main;
...
public
myThread:SendThread;
...
procedure Tmainform.Button3Click(Sender: TObject);
begin
MyThread:=SendThread.Create(False);
end;
unit mySendThread;
interface
uses
Classes,SysUtils;
type
SendThread = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
procedure sendmessage();
public
constructor Create(Suspended:Boolean);
end;
constructor SendThread.Create(Suspended:Boolean);
begin
FreeOnTerminate := True;
inherited Create(Suspended);
end;
procedure SendThread.Execute;
begin
sendmessage;
end;
我现在执行了button3的事件以后,没有问题,当我再次执行时会出错,线程没有释放掉,
请教一下高手解答这个问题,谢谢~~~
...
public
myThread:SendThread;
...
procedure Tmainform.Button3Click(Sender: TObject);
begin
MyThread:=SendThread.Create(False);
end;
unit mySendThread;
interface
uses
Classes,SysUtils;
type
SendThread = class(TThread)
private
{ Private declarations }
protected
procedure Execute;
override;
procedure sendmessage();
public
constructor Create(Suspended:Boolean);
end;
constructor SendThread.Create(Suspended:Boolean);
begin
FreeOnTerminate := True;
inherited Create(Suspended);
end;
procedure SendThread.Execute;
begin
sendmessage;
end;
我现在执行了button3的事件以后,没有问题,当我再次执行时会出错,线程没有释放掉,
请教一下高手解答这个问题,谢谢~~~