枝
枝上柳绵
Unregistered / Unconfirmed
GUEST, unregistred user!
program Project2;
uses
Windows, ScktComp;
var
socket:TClientSocket ;
procedure cs1Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.SendText('aaaa');
end;
begin
...
socket:=TClientSocket.Create(application);
socket.OnConnect:=cs1Connect;
....
end.
好像定义事件函数只能在form类里面,而不能在全局变量中,有没有其他办法呢?
谢谢您的关注
uses
Windows, ScktComp;
var
socket:TClientSocket ;
procedure cs1Connect(Sender: TObject;
Socket: TCustomWinSocket);
begin
Socket.SendText('aaaa');
end;
begin
...
socket:=TClientSocket.Create(application);
socket.OnConnect:=cs1Connect;
....
end.
好像定义事件函数只能在form类里面,而不能在全局变量中,有没有其他办法呢?
谢谢您的关注