Hello,
This code works fine with Win32
//sRTF : String;
procedure TForm1.Button1Click(Sender: TObject);
var
ms1 : TStringStream;
begin
try
ms1 := TStringStream.Create('');
RichMemo1.SaveRichText(ms1);
sRTF := ms1.DataString;
showmessage(sRTF);
except
showmessage('Oups');
end;
ms1.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
ms2 : TStringStream;
begin
try
ms2 := TStringStream.Create(sRTF);
RichMemo2.LoadRichText(ms2);
except
showmessage('Oups');
end;
ms2.Free;
end;
With Win64 :
RichMemo1.SaveRichText(ms1) --> Error RichEditWndProc RunError(216).
The problem seems to be the call of SendMessage(RichEditWnd, EM_STREAMOUT, SF_RTF, LPARAM(@cbs) ); (line 373) from
class function TRichEditManager.SaveRichText(RichEditWnd: Handle; ADst: TStream): Boolean; in file Win32RichMemoProc...
Remark : the button's procedures don't work with gtk2/amd64.
Help. Please. Thanks. Gilles