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

Print content of CRichEditCtrl w/out Framework Support

I've got a plain vanilla CRichEditCtrl in a dialog app, and I want to be able to print the content of the control.  Since I don't have the support of the Framework, how can I print?
0
nbushman
Asked:
nbushman
1 Solution
 
t004024Commented:
Maybe U have to create a CDC object using the CreateDC, and specifying the corresponding Driver and Device names, use this DC and call StartDoc, StartPage and EndPage and EndDoc and do the usual processing U would do in the OnPrint functionality.

If U wanted a print dialog, initialize a CPrintDialog class and work with it. Have never written a code like this personally, but I think that is what MFC must be doing internally, so U must be able to do the same. Just a suggesion.
0
 
mikeblasCommented:
That's obvious: you certainly have to create a DC.  Otherwise, how would you talk to the printer?

.B ekiM

0
 
jtwine100697Commented:
  Take a look at MS Knowledge Base article Q129860, which can be found at: "http://support.microsoft.com/support/kb/articles/q129/8/60.asp".

   It shows how to make/let the Rich Edit control print itself.  I have used it before, it works well.  But it will not properly display its contents if you try to use the suggested Print() function for a Print Preview.

-=- James.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
nbushmanAuthor Commented:
JTWINE - Thanks for the tip!  I had already implemented a very kludgy way to get printing going for my CRichEditCtrl... I was streaming its data into an invisible CRichEditView, and used the view's print support to get the data printed.  It worked, but wasn't very pretty.
0
 
jtwine100697Commented:
  Did what I suggest work for you?  I mean, test it before giving me the points! :P

-=- James.
0
 
jtwine100697Commented:
  Did what I suggest work for you?  I mean, test it before giving me the points! :P

-=- James.
0
 
nbushmanAuthor Commented:
I'll let you know when I test it.  Right now I'm completely swamped with some higher priority stuff.  At any rate, even if your suggestion doesn't work, I still have a way to print my data, so I'm satisfied, and you're welcome to the points!  Thanks man!
0
 
jtwine100697Commented:
  Yer Welcome...

   Peace!

-=- James.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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