Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Print content of CRichEditCtrl w/out Framework Support

Posted on 1998-05-29
8
Medium Priority
?
262 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Industry Leaders: 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!

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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

618 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