Solved

Major points for simple printing question in 95

Posted on 1998-06-25
6
168 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
Comment Utility
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
Comment Utility
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
Comment Utility
Did U try using EndPage of the printer DC???
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:huya
Comment Utility
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
Comment Utility
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
Comment Utility
did that work out for you?

I'm still around if you have any more questions
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
paragon account problem 9 96
either24  challenge 19 84
zeroFront challenge 7 70
Detect file exist or not 3 76
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…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

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