I found source code of Jose for displaying rtf text including images in a RichTextControl.
I want to show several rtf texts (with images) in the RichTextControl one after the other by mouse click. The RichTextControl should not be destroyed during this.
What should I do to free the RichTextControl from the old content, also with regard to memory leaks?
Last edited by Pierre Bellisle; 18 Jan 2019, 03:18 PM.
Hi Pierre, thanks for the reply. If I understand correctly now, it is not necessary to free the RT-Control from the old content before a new RTF is displayed. A simple overwriting seems to be enough. I had doubts about the for me unknown technique OLE/COM Interface. A set STDOUT indicates that the function Reo_DeleteObject is executed each time the content is overridden.
In this context the WM_CLEAR won't do well because the subclassing of the edit.
I saw some font residue using EM_REPLACESEL so it is not as good as I thought.
I don't think of any memory leak but more of some garbage left in the control.
that could be used to clear or replace the text in a clean way.
What might be a little confusing is the use of gTxt as a global.
In fact all you have to do is update it and call RichEditSetString(hEdit).
you helped me a lot, more than you guessed - thank you.
And anyway, it is quite great of you that you always put your expertise here in the forum.
Coding is fun, it's good to share, to give back a little of what other gave to me.