oh sorry i totally messed up. I just realized you were printing from a textbox. sorry about that. Disregard everything i said. :)
Main Topics
Browse All TopicsI need to print the CRichText box. The following just prints a blank page.
The documentation is for VB. No errors when compiled.
void CTestctrlsView::OnPrint(CD
{
:
:
m_CRTextBx.Print(pDC,PRF_O
:
:
CRecordView::OnPrint(pDC, pInfo);
}
Thanks.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OK, here it is: The CRichEditCtrl has no native printing capability. You could dump an image of what is seen on screen, but that will not print the entire contents of the text. However, MFC provide a class named CRichEditView that does all of the work, including pagination, headers, footers, etc.
So, if you could derive from CRichEditView you could insert the derived object in you dialogbox box. Then all CView-specific commands, including the printing-support members, would be availaable.
There are a few tricks you need to know in order to put a CView-derived object into a dialog. The tricks are described here:
http://www.experts-exchang
Printing can be a complicated thing. If you are just starting to learn about it, I highly recommend that you experiment by making a new 'testing-only' MFC AppWizard SDI app which used CEditView as the main view (set this in the last page of the AppWizard). Play around with it, and get to know the details such as how to set the headers, and learn the page-by-page nature, and how all about print-preview, etc. Once you have the concepts down, Try inserting a customized CRichEditView into a simple Dialog-based app (using the info from that link above). Once you are comfortable with all of this, you should be able to transfer that knowledge to your current app.
-- Dan
This question didn't show any activity for more than 21 days. I will ask Community Support to close it unless you finalize it yourself within 7 days.
You can always request to keep this question open. But remember, experts can only help if you provide feedback to their comments.
Unless there is objection or further activity, I will suggest to accept
"DanRollins"
comment(s) as an answer.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
========
Werner
Business Accounts
Answer for Membership
by: JamesMatthewsPosted on 2003-01-27 at 19:42:12ID: 7827057
i am not sure and this is just a suggestion but have you drawn to the pDC elsewhere in your code.if not you need to for there to be any output.you could try adding this to your code somewhere(maybe in the routine you displayed) :
pDC.DrawText(0,0,"put your text here",18) /*where 18 is put the number of characters in your string*/
Once again i may be totally off target. I just wanted to establish wether or not you had yet painted to the pDC
Thank you