Re: Delphi.NET
- From: Daniel Hobson <daniel@xxxxxxxxxxxxxx>
- Date: Thu, 28 Jun 2007 22:35:49 GMT
kennedyri@xxxxxxxxx wrote:
On Jun 27, 3:41 am, "Daniel Hobson" <djhob1...@xxxxxxxxxxxx> wrote:
The source buffer? Are you sure you had the parameters in the right
order? Show your code.
--
Rob
Hi Rob,
Here is the code that we tried.
{$UNSAFECODE ON}
procedure TMainForm.Button1Click(Sender: TObject); unsafe;
type
TTestRec = record
t1: array [1 .. 38] of char;
t2: array [1 .. 22] of char;
end;
var
inputMsg : TBytes;
MyTest : TTestRec;
MySrcPtr : IntPtr;
begin
try
try
{ hostclient is an TidTCPClient component }
hostclient.Connect;
MySrcPtr := IntPtr.Create(@MyTest);
SetLength (inputMsg, 60);
hostclient.IOHandler.ReadBytes (inputMsg, 60, false);
Marshal.Copy(inputMsg, 0, MySrcPtr, 60);
hostclient.IOHandler.Writeln ('Reply');
except
end;
finally
{
Cleanup before exiting.
}
SetLength (inputMsg, 0);
end;
end;
.
- Follow-Ups:
- Re: Delphi.NET
- From: Rob Kennedy
- Re: Delphi.NET
- References:
- Delphi.NET
- From: Daniel Hobson
- Re: Delphi.NET
- From: Rob Kennedy
- Re: Delphi.NET
- From: Daniel Hobson
- Re: Delphi.NET
- From: kennedyri
- Delphi.NET
- Prev by Date: Re: minimize button on a delphi created mainwindow not working on an XP system
- Next by Date: Re: TWebbrowser plugin support
- Previous by thread: Re: Delphi.NET
- Next by thread: Re: Delphi.NET
- Index(es):