在我的表单中添加IdUDPServer并尝试将一些代码放入OnUDPRead事件后,我无法在设计时向表单添加任何组件,也无法运行该应用程序. this is the error i’m getting http://i54.tinypic.com/2j5jl0p.jpg 有什么方
this is the error i’m getting http://i54.tinypic.com/2j5jl0p.jpg
有什么方法可以解决这个问题吗?
这个事件处理程序有两个错误.要修复它们,你可以>删除系统.来自TArray< System.Byte> (在界面和实现中)
>将IdSocketHandle添加到界面中的使用列表中
我没有进一步调查,但在这些更改后,代码可以编译.
所以完整的代码就好了
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;
