Given a custom control CCustomWnd which has its own OnPaint method, what's the simplest way that CCustomWnd::OnPaint can render the contents of a CRichEditCtrl, with the same formatting?
To clarify, elsewhere in my dialog/window is a CRichEditCtrl. I have my custom control which does a bunch of custom-drawing, including drawing the contents of the edit control. Currently it doesn't preserve the formatting, now it needs to (not everything, but color/decoration).
The custom control can't be replaced or substantially rewritten. So essentially given a CDC and a CRichEditCtrl, how do I render the formatted text from the latter using the former?