I am currently porting our software solution from Delphi 7 to 2010. Basically, the changes were simple, and only a small number of obstacles remained.
In the form, we use TRichEdit, which displays the rtf text captured from the blob field in db MSSQL. Here's how it works in Delphi 7:
//Get RTF text from Blob field using TADOQuery rtfStream := sql.CreateBlobStream(sql.FieldByName('rtftext'), BmRead) as TMemoryStream; //Load into TRichEdit RichEdit.PlainText := False; RichEdit.Lines.LoadFromStream(rtfStream);
This displays RTF as expected in the TRichEdit component, but the same code in Delphi 2010 displays RTF as plain text with tabs between each character. I assume this has a lot to do with the change from Ansi to Unicode, but I have not been able to fix the problem.
Any help in getting this to work would be greatly appreciated. Thanks
unicode delphi delphi-2010 ansi richedit
Simon hartcher
source share