cyprus106
Programmer
- Apr 30, 2001
- 654
I have made a chat program, with 2 RichEdits on the client side, one to write the message and one to display it. On the RichEdit to write the message, (RichEdit1) it can make text bold, italic, change the font, etc... But when I try to take the text from RichEdit1 to the Display RichEdit, (RichEdit2) It loses all of it's macros. I know that saving to and loading from a stream can retain the macros, but my problem there is that the:
RichEdit1->Lines->SaveToStream(MyStream);
is alright, but I can't load the stream in the RichEdit2, because it clears all of my previous text. I need the messages the user had written before. I can't save to the clipboard because this will overwrite whatever the user saved. I can't save the text to a file and load it again, because I send the text over a socket to a server and the server sends it back. I don't think I can use FTP to send the rtf back and forth every time. I don't think that would be feasable, although it might. I don't know. I would appreciate it if anyone wiser would know if it would be reasonable to send the text file....?
I think that using streams is the most effective way of sending the rich text, but I can't LoadFromStream. How would I add a line that is a stream to the RichEdit2?
If anyone knows ANY other methods, I would be eternally grateful, as this one problem has held me back in all sorts of situations for almost a year, and I still haven't found a good method. I've tried everything I can think of, but i'm still hardly farther than when I started.
Thanks alot,
Cyprus
RichEdit1->Lines->SaveToStream(MyStream);
is alright, but I can't load the stream in the RichEdit2, because it clears all of my previous text. I need the messages the user had written before. I can't save to the clipboard because this will overwrite whatever the user saved. I can't save the text to a file and load it again, because I send the text over a socket to a server and the server sends it back. I don't think I can use FTP to send the rtf back and forth every time. I don't think that would be feasable, although it might. I don't know. I would appreciate it if anyone wiser would know if it would be reasonable to send the text file....?
I think that using streams is the most effective way of sending the rich text, but I can't LoadFromStream. How would I add a line that is a stream to the RichEdit2?
If anyone knows ANY other methods, I would be eternally grateful, as this one problem has held me back in all sorts of situations for almost a year, and I still haven't found a good method. I've tried everything I can think of, but i'm still hardly farther than when I started.
Thanks alot,
Cyprus