[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Major points for simple printing question in 95

Posted on 1998-06-25
6
Medium Priority
?
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: 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!

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

650 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