• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 730
  • Last Modified:

Printing content of a CRichEditCtrl

I've got a CRichEditCtrl in a CDialog, and I want to print its content.  I don't have a CDocument class, or a CRichEditView class, so I guess I don't have the framework's printing support.  Any ideas on what to do?  Thanks!
0
nbushman
Asked:
nbushman
1 Solution
 
galkinCommented:
To print context of the control use WM_PRINT message passing printer HDC as WPARAM
0
 
mikeblasCommented:
WM_PRINT will only print what's visible in the control at that moment.  (If it even works with RichEdit 1.0; I don't think the control supports it.)

.B ekiM

0
 
nbushmanAuthor Commented:
Would it be possible for me to stream the data from my CRichEditCtrl into a CRichEditView, and to have the CRichEditView handle the printing?  If this can be done, is there a way that I can do it without actually drawing the CRichEditView window?  Can I just instanciate (but not display) a CRichEditView, stream my RTF data into it, and have it print?  If any of this is possible, what is the technique, and do you know of any examples?  THANKS!!!!
0
 
yangjunCommented:
Call CEditViewCtrl::FormPage. It works!

0
 
nbushmanAuthor Commented:
Umm... I don't know why I accepted yangjun's answer.  

His solution, to use CEditViewCtrl::FormPage() is puzzling because as far as I can tell, there ISN'T such a class.  In addition to that, no classes have a FormPage() member function.  What am I missing here?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now