Gene Buckle
2008-07-08 22:57:14 UTC
I'm working on setting up a UDP server to run within a DLL and I'm having
a difficult time assinging the OnUDPRead handler.
Right now I'm working with just an empty handler:
procedure UDPReadHandler(AThread : TIdUDPListenerThread; AData : TIdBytes;
ABinding : TIdSocketHandle);
begin
end;
followed later by...
UDPServer := TIdUDPServer.Create(nil);
UDPServer.DefaultPort := 5502;
UDPServer.Active := true;
UDPServer.OnUDPRead := UDPReadHandler;
The UDPServer.OnUDPRead line generates:
"E2009 Incompatible types: 'method pointer and regular procedure'"
Is there any way I can get around this or do I have to create a class just
to handle this one function?
tnx!
g.
a difficult time assinging the OnUDPRead handler.
Right now I'm working with just an empty handler:
procedure UDPReadHandler(AThread : TIdUDPListenerThread; AData : TIdBytes;
ABinding : TIdSocketHandle);
begin
end;
followed later by...
UDPServer := TIdUDPServer.Create(nil);
UDPServer.DefaultPort := 5502;
UDPServer.Active := true;
UDPServer.OnUDPRead := UDPReadHandler;
The UDPServer.OnUDPRead line generates:
"E2009 Incompatible types: 'method pointer and regular procedure'"
Is there any way I can get around this or do I have to create a class just
to handle this one function?
tnx!
g.
--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.