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.

Recommended Answers

All 3 Replies

what do you want exactly?
if you send 'abcdef' then recieve the whole string?

Stream.Read(S,Length(S));

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

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;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.