在安装DELPHI2005时,我装INDY10,在使用过程中,我用到了TIdUDPServer控件,在ONREAD过程中,提示我未声明TBytes类型,我找帮助也找不着这个类型,请各位大侠指点。unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdBaseComponent, IdComponent, IdUDPBase, IdUDPServer, IdSocketHandle;type
  TForm1 = class(TForm)
    IdUDPServer1: TIdUDPServer;
    procedure IdUDPServer1UDPRead(Sender: TObject; AData: TBytes;
      ABinding: TIdSocketHandle);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.IdUDPServer1UDPRead(Sender: TObject; AData: TBytes;
  ABinding: TIdSocketHandle);
begin
  showmessage('test');
end;end.

解决方案 »

  1.   

    大概是少uses了某一个文件吧?
      

  2.   

    但是一直没找着TBYTES属于哪一个文件啊?
      

  3.   

    Represents a platform-agnostic string representation.Declaration
    TIdBytes = TBytes;
    Description
    TIdBytes is a type that represents a platform-agnostic representation for string data types. TIdBytes isolates the differences between a Delphi string and the .Net representation for string content.
     On the .Net platform, TIdBytes is declared as the TBytes data type. On the all other platforms, TIdBytes is declared an array of Byte data type.TIdBytes is the type used to represent parameter arguments for utility functions, like:
    BytesToInteger 
    BytesToShort 
    BytesToCardinal 
    BytesToString 
    AppendBytes TIdBytes is the type used to represent the return value from utility functions, like:
    ToBytes