Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Printing in MFC

Posted on 1998-12-29
1
Medium Priority
?
268 Views
Last Modified: 2013-11-25
How to print a text file in MFC?
0
Comment
Question by:dmittar
1 Comment
 
LVL 1

Accepted Solution

by:
perrizo earned 200 total points
ID: 1326955
In your view class overload the function

OnPrint(CDC* pDC, CPrintInfo* /*pInfo*/)

you can do this in class wizard.  The pDC variable is you printer device context.  If its just simple text you can use the function

pDC->TextOut(0, 100, _T("some text"));

the first two parameters are the x and y coordinates and then the text you want to print.  The real job of printing, which is different for everyone is getting the text to come out looking like you want.  Good luck
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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

879 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