?
Solved

Major points for simple printing question in 95

Posted on 1998-06-25
6
Medium Priority
?
181 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Integration Management Part 2

850 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