Solved

Printing Multiple Copies

Posted on 1998-07-30
6
346 Views
Last Modified: 2013-12-03
How do I determine if a printer is capable of printing multiple pages. I tried using the DeviceCapabilities function, with the DC_COPIES parameter. This came back with a large number. I assumed that this meant it could print multiple copies. I then put the desired number of copies in the dmCopies parameter of the DEVMODE structure and then created a device context with the DEVMODE as the third parameter. It did not work. The printer was a Xerox laser, so I assume it should be able to,
0
Comment
Question by:philsmicronet
6 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1411653
how did you create the device?  with CreateDC()?  This might be more for use by OpenPrinter().  I'm just guessing though.
0
 

Expert Comment

by:aborman
ID: 1411654
How are you sending the info to the printer?
0
 
LVL 1

Author Comment

by:philsmicronet
ID: 1411655
I used CreateDC to create the device context. We are using normal Device context commands.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 8

Accepted Solution

by:
Answers2000 earned 50 total points
ID: 1411656
DeviceCapabilities is the correct function but you're using it wrong.

1st & 2nd parameters - you pass the strings for currently chosen printer.

3rd parameter : The capability you're interested is is DC_COPIES.
But pass NULL for the DEVMODE parameter.

4th parameter is NULL.

5th parameter is NULL

Look at the return value from DeviceCapabilites.  -1 means an error occurred (e.g. the setup or driver is messed up, or you passed the wrong strings) other values give you the max number of copies you can print.
0
 
LVL 1

Author Comment

by:philsmicronet
ID: 1411657
I'm still having problems with this. I have done as suggested and the Device Capabilities function does seem to work as required. If the printer supports multiple copies then it returns a large number. If the printer does not it seems to return 0. I then set the dmCopies field of the devmode structure and create the Device Context. However this does not seem to cause it to print multiple copues. Any ideas.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411658
I hope you haven't been working on this solidly since August!  : - )  

Post your code so we can see it.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

13 Experts available now in Live!

Get 1:1 Help Now