I have developed my own Report Control which is simply nothing but drawing text on a CDC of the control window\'s client DC. I have got the printing function to work too. Th
if you managed to print your output to a file in an RTF format and displayed it on screen would this solve the problem?
I had tweeked this code in order to compile it as static lib. It is for dialog based applications.
If you don't need special functionality it will work ok for you.
I had to dig through MFC mechanisms to add extra functionality but at the end I dropped it. If you know other programming languages, try to find a print preview control in that language, make it a dll and use it from your MFC application.
For example, I found the NicePreview control for Delphi and it worked, for me, beautifully !
Print preview isn't that special. It just means that you have to render to screen (or bitmap) what you'd otherwise would render to the printer DC. This primarly means using the page size, and providing a UI control for the prev/next page.
There is a class CPreviewView in MFC. Maybe you can find a way to instantiate it without MDI structure.
Otherwise, you can simply paint on screen whatever you are painting on the printer DC. Just remember that you will probably need to scale it down for lower dpi.