Using ExtDeviceMode() with DM_COPY

Last reviewed: August 12, 1997
Article ID: Q77551

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.1 and 3.0

SUMMARY

The documentation for the ExtDeviceMode() API does not completely explain the results of setting the wMode parameter to various values, in particular the DM_COPY value. This function may produce unexpected results if the wMode parameter is set incorrectly.

MORE INFORMATION

For a complete explanation of the ExtDeviceMode() API, see the "Microsoft Windows Software Development Kit Guide to Programming," in particular, the following paragraph

   IMPORTANT: In order to change the settings, you must specify at
   least one input value and one output value.... If you specify only
   output values (DM_COPY or DM_UPDATE), the driver provides its
   current settings and ignores any input you provide. If you specify
   only input values (DM_MODIFY or DM_PROMPT), calling ExtDeviceMode
   generates no output, so your input has no real effect.

If the wMode parameter is set to DM_COPY only, the printer's default settings will be copied into the output buffer -- even if an input buffer is specified.

In some cases, it is necessary to copy the print settings from the input buffer to the output buffer (for example, to validate some fields in the structure). To do this, set the wMode parameter to (DM_COPY | DM_MODIFY).

Note that DM_IN_BUFFER, DM_IN_PROMPT, DM_OUT_BUFFER, and DM_OUT_DEFAULT are aliases for the DM_MODIFY, DM_PROMPT, DM_COPY, and DM_UPDATE constants, respectively.

Keywords          : GdiPrn kb16bitonly kbhowto
Version           : 3.0 3.1
Platform          : WINDOWS
Issue type        : kbdocerr kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.