If I drop a TRichedit on my form, I can't paste RTF with images in my control. From what I understand this is due to the fact that Delphi 2007 uses an old version of the Richedit control. Is there an easy way to use the latest Richedit control on a Form with Delphi 2007?
Asked
Active
Viewed 1,108 times
0
-
How did you determine that using the latest richedit control would change anything here? – David Heffernan Nov 16 '14 at 22:22
-
That's what I initially thought David. Some further research shows that I probably need to OLE enable my richedit too, which seems not that simple. Have you ever done that? – Emmanuel Ichbiah Nov 16 '14 at 22:24
-
Do you have a source for this information – David Heffernan Nov 16 '14 at 22:30
-
The following discussion for example: http://www.codenewsfast.com/cnf/article/1755643992/permalink.art-ng1619q19167 – Emmanuel Ichbiah Nov 16 '14 at 22:35
1 Answers
5
The following article explains how to do it in Delphi 2010, the procedure would be similar for Delphi 2007:
Using Richedit 4.1 with D2010 1
1: the above link has been dead since early 2019, but there is an archived copy on archive.org
The gist of it is to make a copy of the VCL's ComCtrl.pas
source file, modify it to have TRichEdit
load the latest RichEdit DLL and specify the latest RichEdit control class name, and then you can add the modified file to your project.

Remy Lebeau
- 555,201
- 31
- 458
- 770
-
I did see that article and did modify my ComCtrls.pas accordingly. But I was still not able to paste RTF with images after that ... – Emmanuel Ichbiah Nov 16 '14 at 21:30
-
1This is the answer to the question you asked. This is why it is often best to ask for help with your problem rather than with your solution. – David Heffernan Nov 16 '14 at 22:34
-
Did you see that I said "From what I understand ..." ... ? If I had a complete picture, I would probably not even ask ... – Emmanuel Ichbiah Nov 16 '14 at 22:42
-
2@Emmanuel - Nevertheless the question is what it is. In its current form I can't even suggest you to use TJvRichEdit, the successor of TRxRichEdit, since it has nothing to do with using the control in msftedit.dll - although it would solve your problem. – Sertac Akyuz Nov 17 '14 at 03:05
-
@Sertac, I should have mentionned that I prefer a solution without third party component. Now if the wording of my question is not perfect, excuse me. But it is a hassle to always get this criticism when asking ... It would be a lot more useful at that point, if somebody explained how to OLE enable the Delphi TRichEdit. – Emmanuel Ichbiah Nov 17 '14 at 08:38
-
3@Emmanuel - Implement and pass an IRichEditOleCallback in an EM_SETOLECALLBACK. The control I mentioned is open source. BTW, the criticism is not about your question, it is in fact quite clear and exact. Criticism is about your expectation of having an answer to what you haven't asked. – Sertac Akyuz Nov 17 '14 at 09:14
-
@Sertac, your advice to use TJvRichedit is a very good advice. And I think you did a perfect job guessing what I needed. I think that by telling «I can't paste RTF images» I clearly expressed what I wanted to do. It was just my assumptions why I didn't work that were misleading. – Emmanuel Ichbiah Nov 17 '14 at 10:15
-
1@Emmanuel What you perhaps have not realised is that we answer the question ask. In this case I think you asked the wrong question. You really should accept Remy's answer since it the answer to the question you asked. Next time you ask, it is best to ask about the problem you face rather than your solution to it. – David Heffernan Nov 17 '14 at 14:08
-
@EmmanuelIchbiah: it does not matter if Sertac guessed what you **wanted** (how to paste an image in `TRichEdit`). You did not ask a question about **that** issue, you asked about a different issue (how to enable the latest RichEdit version in `TRichEdit`). Those are two different questions. I answered the question you **asked**, per StackOverflow's guidelines. This is a Q&A site, answers must reflect the *actual* questions asked, not the *implied* questions. If you asked the wrong question then close this one and post a new one. – Remy Lebeau Nov 17 '14 at 17:51
-
It does matter. What's most important? The fact that I get helped. Please spare me your comments about how I should ask a question. I ask it the way I want and you feel free to help or not. Basta. – Emmanuel Ichbiah Nov 17 '14 at 18:07
-
By the way you can put as many minus points on my question as you want. I don't care. I am not here to win points. I am here as long as I can learn something. I know, I should learn how to ask, I will ... in my next life. :-))) – Emmanuel Ichbiah Nov 17 '14 at 18:09
-
What is important is creating a useful resource for the future. If you don't like that then you are in the wrong place. If you have a problem with that then you can ask about it on meta. We could all see what your problem was. Sertac was no more clever than anyone else. But unfortunately you didn't ask about your problem. All we can do is answer the question that you asked. All you need to do is accept remy's answer to the question you asked and then ask a new question about your real problem. That would benefit future visitors. – David Heffernan Nov 17 '14 at 18:15
-
Concentrate on helping rather than arguing. This is what makes this site interesting. Sertac was definitively cleverer than you David, you are too stiff to help sometimes. – Emmanuel Ichbiah Nov 17 '14 at 18:19
-
Why don't you ask on meta. Please stop being impolite. I doubt that @Sertac feels any differently than I do. His comments make that clear. – David Heffernan Nov 17 '14 at 18:22
-
-
@EmmanuelIchbiah http://meta.stackoverflow.com/ but please read a few articles there before asking, just to get a feeling how to ask. – bummi Nov 17 '14 at 18:37
-
You are welcome here. So long as you keep it polite. All we are trying to explain, and Remy, Sertac and myself have said exactly the same, is that the site expects us to answer the question that was asked. You accepted thee answer. That's good. Feel free to ask a new question about your real problem. That would be valuable. – David Heffernan Nov 17 '14 at 18:39
-
2the problem is that Delphi 2007 is not unicode and RichEdit versions > 2.0 are available only in "Wide" versions (not Ansi) – MtwStark Sep 01 '17 at 11:23