3.5.4 RESETDEVICE and STARTDOC Escapes

To support the ResetDC and StartDoc functions (new for Windows 3.1), printer drivers must process the RESETDEVICE and STARTDOC escapes in their Control functions.

Although the STARTDOC escape was available in Windows 3.0, the lpInData and lpOutData parameters have changed. Specifically, lpInData points to a null-terminated string specifying the name of the document, and lpOutData points to a DOCINFO structure specifying the output port or file, as well as the document name. The structure has the following form:

typedef struct {

short cbSize;

LPSTR lpszDocName;

LPSTR lpszOutput; // output port name

} DOCINFO, FAR * LPDOCINFO;

The lpszOutput member is the name of the output file to use. If either lpOutData or lpszOutput is NULL, the output port given to the CreateDC function should be used.

The RESETDEVICE escape, corresponding to the new ResetDC function, allows the driver to move a printer's output state from an old physical device structure to a new one. This allows applications to change the printer setup, such as orientation, with creating a new print job. For more information about this escape, see the RESETDEVICE escape in the Microsoft Windows Device Driver Adaptation Guide.