To function propely, the RTF control has to be hosted on a form. You don't have to make form visible though.
>I created a class OC1, to which I added the RichTextControl, to OCRich2.vcx.
>
>I added the following code to a .prg file.
>
>SET CLASSLIB TO OCRich2
>oRich = CREATEOBJECT('OC1')
>
>and came up with error 1744, "Object class is invalid for this container error."
>
>Is this because the RichTextControl can only be used in classes associated with forms? Is there a way to set up oRich = CREATEOBJECT('OC1') within a custom class?
>
--sb--