StartDoc

3.1

  int StartDoc(hdc, lpdi)    
  HDC hdc; /* handle of device context */
  DOCINFO FAR* lpdi; /* pointer to DOCINFO structure */

The StartDoc function starts a print job. For Windows version 3.1, this function replaces the STARTDOC printer escape.

Parameters

hdc

Identifies the device context for the print job.

lpdi

Points to a DOCINFO structure containing the name of the document file and the name of the output file. The DOCINFO structure has the following form:

typedef struct {    /* di */
    int     cbSize;
    LPCSTR  lpszDocName;
    LPCSTR  lpszOutput;
} DOCINFO;

For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.

Return Value

The return value is positive if the function is successful. Otherwise, it is SP_ERROR.

Comments

Applications should call the StartDoc function immediately before beginning a print job. Using this function ensures that documents containing more than one page are not interspersed with other print jobs.

The StartDoc function should not be used inside metafiles.

See Also

EndDoc, Escape