Solved

Major points for simple printing question in 95

Posted on 1998-06-25
6
172 Views
Last Modified: 2013-11-20
I'm writing an app and doing the printing manually by adding code to OnPrint function.

My problem is that according to the help, each time OnPrint is called, it allows printing a specific page number.... i.e. first call, all printing goes to page 1, second call, all printing goes to page 2.

My question is :
In the middle of printing to the device context of OnPrint (ie. pDC), is there a way to change the page number that the printing is going to without exiting the OnPrint function and waiting for the next call?

Need answer ASAP!!
0
Comment
Question by:huya
6 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1318402
OnPrint function is passed pointer to CPrintInfo structure as second parameter. This structure has field m_nCurPage that is current page. I guess you can change this field at any stage.
0
 

Author Comment

by:huya
ID: 1318403
I've tried that.  What happens is that what ever was printed on page n gets erase and the new data being printed goes onto page 2.
0
 

Expert Comment

by:t004024
ID: 1318404
Did U try using EndPage of the printer DC???
0
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.

 

Author Comment

by:huya
ID: 1318405
I just tried it.... did not work.  Again, it refreshes the age, but I lose the page I was printing on.

Any ideas??
0
 
LVL 2

Accepted Solution

by:
lucidity earned 350 total points
ID: 1318406
you can't do it the way you want to. Its time to bow your head in shame and obey windows. Process the OnPrint function according to spec, let the Print and Print Preview functions get normal parameters. The problem is that the OnPrint function expects one page of data, if you go over you get overflows and that ,my friend, is bad news. Just print the appropriate page when it is asked for. If you need code to help parse the data into pages for you let me know.

good luck...
Jason
0
 
LVL 2

Expert Comment

by:lucidity
ID: 1318407
did that work out for you?

I'm still around if you have any more questions
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
Folder Comparison 12 53
iSeries DB2 Query 2 90
if loop in java 3 128
building a service to accessed via telnet client, want colors ? 4 81
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: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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.

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

20 Experts available now in Live!

Get 1:1 Help Now