Re: Interfacing with Comm32 Component
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Fri, 18 Jan 2008 00:19:27 -0600
Rudy Velthuis wrote:
Andy Massey wrote:The procedure in my user program is:
procedure TForm1.Comm321ReceiveData(Buffer: Pointer; BufferLength:
Word);
I can't figure out how to get the characters in the Buffer (type of
Pointer) into a string that I can use in a memo control.
Try:
Memo1.Lines.Append(PChar(Buffer));
Better yet:
var
s: AnsiString;
begin
SetString(s, Buffer, BufferLength);
Memo1.Lines.Add(s);
end;
The presence of a BufferLength parameter suggests that there won't necessarily be a null character marking the end of the buffer. There might even be null characters in the middle of the buffer.
--
Rob
.
- References:
- Interfacing with Comm32 Component
- From: Andy Massey
- Re: Interfacing with Comm32 Component
- From: Rudy Velthuis
- Interfacing with Comm32 Component
- Prev by Date: Re: TChart: sliding window??
- Next by Date: Length of Tenumeration has got to be fixed/implemented
- Previous by thread: Re: Interfacing with Comm32 Component
- Next by thread: Re: Interfacing with Comm32 Component
- Index(es):
Relevant Pages
|