Solved

Printing Multiple Copies

Posted on 1998-07-30
6
357 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
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…

832 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