?
Solved

Print content of CRichEditCtrl w/out Framework Support

Posted on 1998-05-29
8
Medium Priority
?
261 Views
Last Modified: 2013-11-19
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
Comment
Question by:nbushman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Expert Comment

by:t004024
ID: 1315750
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
 
LVL 11

Expert Comment

by:mikeblas
ID: 1315751
That's obvious: you certainly have to create a DC.  Otherwise, how would you talk to the printer?

.B ekiM

0
 
LVL 4

Accepted Solution

by:
jtwine100697 earned 400 total points
ID: 1315752
  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
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!

 

Author Comment

by:nbushman
ID: 1315753
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
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1315754
  Did what I suggest work for you?  I mean, test it before giving me the points! :P

-=- James.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1315755
  Did what I suggest work for you?  I mean, test it before giving me the points! :P

-=- James.
0
 

Author Comment

by:nbushman
ID: 1315756
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
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1315757
  Yer Welcome...

   Peace!

-=- James.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question