__fastcall testthread::testthread(bool CreateSuspended)
: TThread(CreateSuspended)
{
}
//---------------------------------------------------------------------------
void __fastcall testthread::Execute()
{
Form1->Label1->Caption="hello";
c1=new TServerSocket(0);
c1->Port=31977;
c1->Active =true;
c1->OnAccept=ServerSocketAccept;
Sleep(20000);
//---- Place thread code here ----
}
//---------------------------------------------------------------------------
void __fastcall testthread::ServerSocketAccept(TObject *Sender,
TCustomWinSocket *Socket)
{
Form1->Label1->Caption ="accept";
}
又继续做了第二次实验,连接是存在的,就是不能调用onaccept,莫非真的验证了无忌兄的观点?