Printing Multiple Copies

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,
LVL 1
philsmicronetAsked:
Who is Participating?
 
Answers2000Connect With a Mentor Commented:
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
 
nietodCommented:
how did you create the device?  with CreateDC()?  This might be more for use by OpenPrinter().  I'm just guessing though.
0
 
abormanCommented:
How are you sending the info to the printer?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
philsmicronetAuthor Commented:
I used CreateDC to create the device context. We are using normal Device context commands.
0
 
philsmicronetAuthor Commented:
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
 
nietodCommented:
I hope you haven't been working on this solidly since August!  : - )  

Post your code so we can see it.
0
All Courses

From novice to tech pro — start learning today.