Вот такая ошибка:
First chance exception at $03AE85C4. Exception class $C000001D with message 'system exception (code 0xc000001d) at 0x03ae85c4'. Process Price.exe (11080)
Возникает при завершении процедуры ParseRequest()
Вот код:
Код:
type PNetProtocol = ^TNetProtocol;
TNetProtocol = record
command:integer;
data:array [0..15] of integer;
text:string[255];
end;
...
const CMD_TEST = 6;
...
TCPClient: TTcpClient;
...
Procedure TForm1.ParseRequest();
var ReciveProtocol:TNetProtocol;
i:integer;
Buf: PByteArray;
begin
i := TCPClient.ReceiveBuf(Buf,SizeOf(ReciveProtocol));
System.Move(Buf,ReciveProtocol,SizeOf(ReciveProtocol));
case ReciveProtocol.command of
CMD_TEST:
begin
ShowMessage(ReciveProtocol.text);
end;
end;
end;
procedure TForm1.ToolButton7Click(Sender: TObject);
var Protocol: TNetProtocol;
begin
if TCPClient.Connect then
begin
Protocol.command := CMD_PRICE_LIST;
TCPClient.SendBuf(Protocol,SizeOf(Protocol));
ParseRequest();
TCPClient.Disconnect;
end
else
ShowNoConnectMessage();
end;
Админ: Пользуемся тегами по оформлению кода!
Пробовал оставить в процедуре только эту строку:
i := TCPClient.ReceiveBuf(Buf,SizeOf(ReciveProtocol));
эффект тот же.
Уже мозг закипает. Не пойму в чем дело. Может глянете незамутненным глазом?