Solved

Major points for simple printing question in 95

Posted on 1998-06-25
6
173 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
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.

777 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