代码如下:
procedure TForm1.Button2Click(Sender: TObject);
var
comm:Tcommblock;
begin
comm.SenderName:=edit4.Text;
comm.Msg:=edit5.Text;
memo1.Lines.Add(comm.SenderName+':'+comm.Msg);
idudpclient1.SendBuffer(RawToBytes(comm,sizeof(comm)));
end;procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: array of Byte; ABinding: TIdSocketHandle);
var
comm:TCommBlock;
begin
BytesToRaw(AData,comm,SizeOf(Tcommblock));//在这个位置提示错误信息:{unit1.pas(80,17) Error: Incompatible type for arg no. 1: Got "Open Array Of Byte", expected "TIdBytes"}memo1.lines.add(comm.SenderName+':'+comm.Msg);
end;end. 请问怎么改正啊!
procedure TForm1.Button2Click(Sender: TObject);
var
comm:Tcommblock;
begin
comm.SenderName:=edit4.Text;
comm.Msg:=edit5.Text;
memo1.Lines.Add(comm.SenderName+':'+comm.Msg);
idudpclient1.SendBuffer(RawToBytes(comm,sizeof(comm)));
end;procedure TForm1.IdUDPServer1UDPRead(AThread: TIdUDPListenerThread;
const AData: array of Byte; ABinding: TIdSocketHandle);
var
comm:TCommBlock;
begin
BytesToRaw(AData,comm,SizeOf(Tcommblock));//在这个位置提示错误信息:{unit1.pas(80,17) Error: Incompatible type for arg no. 1: Got "Open Array Of Byte", expected "TIdBytes"}memo1.lines.add(comm.SenderName+':'+comm.Msg);
end;end. 请问怎么改正啊!
解决方案 »
- Delphi有AMF协议的相关控件吗?
- 添加数据错误
- 如何把Edit中的值赋给DBGrid表中对应的列值呢?
- 欢迎D区来了个强人--牧野同志.特此散分迎接....(续...)
- 哪里有透明的ScrollBox?
- 总是提示我的INSERT INTO输入错误?
- 怎样去掉DELPHI的及时调式功能呀(程序一有错就冒出个DELPHI跳入内存了也不询问)~~
- 那里有比较全面的delphi语言参考手册下载?
- 那里有delphi6 for linux 下载?
- 图形菜单是如何制作的?(用Delphi)
- socket连接solaris上的oracle数据库出现死机
- delphi6 中ppReport 打印的时候如何让其不出现预览界面而是直接打印?哪位大哥能帮忙解决一下?多谢!
var
Buf: TDataPack;
BByte: TIdBytes;begin
AContext.Connection.IOHandler.ReadBytes(BByte, SizeOf(Buf), False);
BytesToRaw(BByte, Buf, SizeOf(Buf));