G
goodman
Unregistered / Unconfirmed
GUEST, unregistred user!
我想写过通用的方法,用了个UNIT,里面全是自定义的过程和函数的,没有FORM,控件在里都
是自生成的,如unit transact;
interface
uses Messages, SysUtils, Variants,Classes,IdUDPBase, Dialogs,IdUDPServer, IdBaseComponent, IdComponent, IdTCPServer,
IdUDPClient, IdTCPConnection, IdTCPClient,IdStack,ExtCtrls;
procedure settimer;
procedure judgemethod;
procedure Gtcpclientcreate(Gtcpclient:tIdtcpclient;ghost:string;gport,cbuffersize,ctimeout:integer);
procedure Gtcpclientfree(Gtcpclient:tIdtcpclient);
procedure Gtcpclientsendstring(s,ghost:string;gport,cbuffersize,ctimeout:integer);//SEND DATA TO SERVER IN IDTTCPCLIENT PROTOCOL
implementation
procedure settimer;
var gtime:ttimer;
begin
gtime:=ttimer.Create(nil);
gtime.OnTimer:=judgemethod;
end;
procedure judgemethod;
begin
....
end;
结果不行,说什么'incompatible types:'method pointer and regular procedure '
哪位高手帮帮手啊,这个定时器是一定要用的,我在有FORM中定给过程时是没问题的
是自生成的,如unit transact;
interface
uses Messages, SysUtils, Variants,Classes,IdUDPBase, Dialogs,IdUDPServer, IdBaseComponent, IdComponent, IdTCPServer,
IdUDPClient, IdTCPConnection, IdTCPClient,IdStack,ExtCtrls;
procedure settimer;
procedure judgemethod;
procedure Gtcpclientcreate(Gtcpclient:tIdtcpclient;ghost:string;gport,cbuffersize,ctimeout:integer);
procedure Gtcpclientfree(Gtcpclient:tIdtcpclient);
procedure Gtcpclientsendstring(s,ghost:string;gport,cbuffersize,ctimeout:integer);//SEND DATA TO SERVER IN IDTTCPCLIENT PROTOCOL
implementation
procedure settimer;
var gtime:ttimer;
begin
gtime:=ttimer.Create(nil);
gtime.OnTimer:=judgemethod;
end;
procedure judgemethod;
begin
....
end;
结果不行,说什么'incompatible types:'method pointer and regular procedure '
哪位高手帮帮手啊,这个定时器是一定要用的,我在有FORM中定给过程时是没问题的