Solved

Print content of CRichEditCtrl w/out Framework Support

Posted on 1998-05-29
8
256 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
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 100 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 157
Fibonacci challenge 11 121
Change to event 1 112
Problem to App source 6 39
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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