1

How do you mimick a TRichEdit in a formless unit?

I want to be able to add formatted text to it.

After all processes have been processes have been perform then the finally will pass the formatted data as a param to an actual TRichEdit...

TIA

  • If I remember right, a rich edit control requires a parent window of some sort. You can declare, create, and use it from another unit, but upon creation you must assign it a parent form. – Jerry Dodge May 15 '15 at 18:42
  • 4
    Use a [Windowless RichEdit control](https://msdn.microsoft.com/en-us/library/windows/desktop/bb787609(v=vs.85).aspx). – Remy Lebeau May 15 '15 at 19:17
  • 2
    Windowless rich edit is the "right" way to do this. For a cheap and nasty alternative create a hidden form, make a TRichEdit with that form as its parent and put a cloths peg on your nose. – David Heffernan May 15 '15 at 19:36
  • Up-voted comment for the "peg on your nose". :) – Deltics May 15 '15 at 22:09
  • 1
    There's an example of using a windowless RichEdit from Delphi by [Rob Kennedy](http://stackoverflow.com/users/33732/rob-kennedy) at GitHub [here](https://gist.github.com/rkennedy/1482014). See the `TOM.pas` unit. – Ken White May 16 '15 at 00:42
  • @RobKennedy's code is essential because this interface is erroneously declared with fastcall calling convention, and thus unreachable from Delphi. Rob's code solves that. – David Heffernan May 16 '15 at 17:49

0 Answers0