After adding a IdUDPServer
to my form and trying to put some code into the OnUDPRead
event, I'm not able to add any component to my form at design time, nor can I run the application.
is there any way to solve this ?
After adding a IdUDPServer
to my form and trying to put some code into the OnUDPRead
event, I'm not able to add any component to my form at design time, nor can I run the application.
is there any way to solve this ?
There are two bugs with this event handler. To fix them, you can
TArray<System.Byte>
(in the interface and implementation)IdSocketHandle
to the uses list in the interfaceI have not investigated further but after these changes the code can be compiled.
So the full code would like be
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,
IdSocketHandle, // <-- added
IdBaseComponent, IdComponent, IdUDPBase, IdUDPClient, IdUDPServer;
type
TForm12 = class(TForm)
IdUDPClient1: TIdUDPClient;
IdUDPServer1: TIdUDPServer;
procedure IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
AData: TArray<Byte>; ABinding: TIdSocketHandle);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
{$R *.dfm}
procedure TForm12.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
AData: TArray<Byte>; ABinding: TIdSocketHandle);
begin
//
end;