How is it possible to send RichViewEdit text through a Client Socket?
I am trying to design a Chat program through TCP/IP
Any advice would be welcome, a small example would be excellent!
Many thanks.
ps: TRichViewEdit & TRichView are the best Components available, I don't think anything even comes close to them.
Send RichViewEdit Text though a Socket?
I would not send RV-Internal objects but use a serializer and deserializer to send text and object through a socket.
There are plenty of examples out there that hint you on how to implement serialization. Here you have one example for an XML Serializer:
http://www.dragonsoftru.com/delphi_vcl.php
There are plenty of examples out there that hint you on how to implement serialization. Here you have one example for an XML Serializer:
http://www.dragonsoftru.com/delphi_vcl.php
Hi,
Thank you very much for replying. I think the serializer is way beyond me at the moment, I am just a novice!
I am using the ICS Components, with two WSockets, one as a Server and another as the Client.
I have managed to get the text sent through by using:
The problem is that this is adding two squares at the end of the text in the RichView like: and in the RichView that I send to in the Remote machine it sends it like:
Could somebody please explain how I can send strings from RichView through a socket like it would be done through a Memo, ie: Memo1.Lines.Add('This is a test'); and Memo1.Lines.Text?
Are there any chat programs using TRichViewEdit & TRichView Demos available anywhere that anyone knows of?
Many thanks for helping
Thank you very much for replying. I think the serializer is way beyond me at the moment, I am just a novice!
I am using the ICS Components, with two WSockets, one as a Server and another as the Client.
I have managed to get the text sent through by using:
Code: Select all
CliSock.LineMode := True;
CliSock.SendStr(RichViewEdit2.RVData.Items.Text + #13#10);
RichView1.AddNL('Local> ' +RichViewEdit2.RVData.Items.Text ,1,0);
RichViewEdit2.FormatTail;
RichView1.FormatTail;
Code: Select all
Local> test ◙◙
Code: Select all
Remote> test◙
Remote> ◙
Are there any chat programs using TRichViewEdit & TRichView Demos available anywhere that anyone knows of?
Many thanks for helping
-
- Site Admin
- Posts: 17555
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: