Solved

Print content of CRichEditCtrl w/out Framework Support

Posted on 1998-05-29
8
253 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
Comment Utility
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
Comment Utility
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
Comment Utility
  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
 

Author Comment

by:nbushman
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 4

Expert Comment

by:jtwine100697
Comment Utility
  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
Comment Utility
  Did what I suggest work for you?  I mean, test it before giving me the points! :P

-=- James.
0
 

Author Comment

by:nbushman
Comment Utility
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
Comment Utility
  Yer Welcome...

   Peace!

-=- James.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 85
Running shell command from Access 3 63
while loop over for loop 7 79
format the code in java 6 72
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now