Solved

How do i print ?

Posted on 2000-05-10
1
189 Views
Last Modified: 2013-11-20
I have  aCFormView with three edit boxes:

IDC_MYEDIT1      with CString m_Myedit1
IDC_MYEDIT2      with CString m_Myedit2
IDC_MYEDIT3      with CString m_Myedit3

these are positioned in various parts of the dialog box.

What I want to do is print what's contained in these boxes to a printer.

I've tried various example's but can't get this to work and was wondering if anyone knew of any code examples ?

Thanks !
0
Comment
Question by:KAbbott
1 Comment
 
LVL 1

Accepted Solution

by:
tvanceplus earned 50 total points
ID: 2797795
This won't have any formatting, but you can customize that to whatever you want. This will print your items on three separate lines at the top left of the page when the user clicks File|Print.


CMyFormView::OnPrint(CDC* pDC,
                 CPrintInfo* pInfo){


int line=pDC->GetTextExtent("||").cy;
int y=0;

pDC->TextOut(0,y,m_myEdit1);
y+=line;
pDC->TextOut(0,y,m_myEdit2);
y+=line;
pDC->TextOut(0,y,m_myEdit3);

}


Good Luck!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sumDigits challenge 9 122
viewing source code from eclipse 13 88
centeredAverage challenge 8 130
firstChar challenge 13 107
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…
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 I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

21 Experts available now in Live!

Get 1:1 Help Now