0

Hi
I am using named pipes to transfer text between vc++ and delphi.
The delphi code is shown below:

procedure TForm1.OnServerPipeMessage(Sender: TObject; Pipe: Cardinal; Stream: TStream);
var
S : String;

begin
        SetLength(S, Stream.Size);
  Stream.Read(S[1], Length(S));
  Memo1.Lines.Add(S);

end;

The problem i face is that I am able to receive only one character at delphi end. For example if i send "abcdefg" from vc++ then I receive the starting character i.e 'a' at Delphi end. I am using 'rllibby' pipes.pas unit.

It would be great, if anyone could help me with the code.
Thank you.

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by FlamingClaw
0

If i read it like below...then i get 0 displayed in the memo

Stream.Read(S[1], Length(S));
Memo1.Lines.Add(S);

i think there is some incompatibility between delphi and vc++.. which i am not able to figure out

0
procedure TForm1.Button1Click(Sender: TObject);
Var count: Integer;
begin
 count := Memo1.Lines.Count-1;

 If Memo1.Lines.Count = 0 then
  Memo1.Text := Edit1.Text
 Else
  Memo1.Lines[count] := Memo1.Lines[count] + S;
end;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.