Solved

Printing Multiple Copies

Posted on 1998-07-30
6
363 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
[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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dir function fails on mapped drives 28 154
ODBC Connection; Switch between 2 SQL Databases VBA 11 146
Problem to open text file 11 145
Where does legacy ASP.NET initialize language? 2 102
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…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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