Parameter Type and Description
- char cShortSessionID
- Presentation space short session ID.
- const PRINTINFO * const pPrintInfo
- Pointer to PRINTINFO structure, where the printer settings are
mentioned.
- nFlags
- Combination of bit flags that indicates which members in the
structure are valid. These flags can be used independently or by ORing
them together to restore the property page (defined in PCSAPI32.H).
The flags, along with the corresponding valid members in the structure,
are as follows:
- Flag
- Valid members in the structure
- PCS_PRINT_PDT
- bPDTMode, lpPDTFile
- PCS_PRINT_PRINTMODE
- nPrtMode, lpPrtToDskAppFile, lpPrtToDskSepFile, lpPrinterName
- PCS_PRINT_PROMPT_DIALOG
- bPromptDialog
- nBufSize
- Must be set to 0. This is ignored.
- nSizeNeeded
- Must be set to 0. This is ignored.
- bPromptDialog
- Possible values are as follows:
- If TRUE, the Printer Setup dialog is shown before printing.
- If FALSE, the Printer Setup dialog is not shown before printing.
- bPDTMode
- Possible values are as follows:
- If TRUE, the connection is set to PDT mode.
- If FALSE, the connection is set to non-PDT mode (GDI mode).
- lpPDTFile
- Used only if bPDTMode is set to TRUE. This is ignored if bPDTMode
is set to FALSE.
This is a null-terminated string containing the name of the PDT file and must be one of the following:
- NULL
The PDT file that is currently configured in the connection is used. If there is no PDT file already configured in the connection, the API fails with an exception.
- File name, without the path
lpPDTFile in the PDFPDT subfolder in the Z and I Emulator for Windows installation path is used.
- Fully qualified path name of the file
If lpPDTFile does not exist, the API fails.
- NULL
- nPrtMode
- This is an enumerated value that indicates the PrintMode of
the connection. The enum data type PRINTMODE is defined in PCSAPI32.H.
The nPrtMode setting must be one of the following:
- PrtToDskAppend (Print to
Disk-Append mode)
This is equivalent to selecting the Append option in the host session Printer Setup → Printer → Print to Disk dialog.
- PrtToDskSeparate (Print
to Disk-Separate mode)
This is equivalent to selecting the Separate option in the host session Printer Setup → Printer → Print to Disk dialog.
- WinDefaultPrinter (Windows
Default Printer mode)
This is equivalent to selecting the Use Windows Default Printer option in the host session Printer Setup dialog.
- SpecificPrinter (Specific
Printer mode)
This is equivalent to selecting a printer in the host session Printer Setup dialog, while leaving the Use Windows Default Printer option unchecked.
- PrtToDskAppend (Print to
Disk-Append mode)
- lpPrtToDskAppFile
- This is used only if nPrtMode is set to PrtToDskAppend.
This is a null-terminated string containing the name of the Print to Disk-Append file and must be one of the following:
- NULL
The file that is currently configured for the PrtToDskAppend mode in the connection is used. If there is no PDT file already configured in the connection, the API will fail.
- File name, without the path
The user-class application data directory path is used to locate the file. If the file exists, it is used. Otherwise, it will be created when printing is complete.
- Fully qualified path name of the file
The directory must exist in the path, or the API will fail. It is not necessary that the file exist in the path.
- NULL
- lpPrtToDskSepFile
- The possible values are as follows:
- Fully qualified path name of the Print to Disk-Separate file for the session.
- An empty string ("") if no Print to Disk-Separate file is configured for the session.
- A truncated file name if the buffer size is not sufficient. The nSizeNeeded member contains the size of the buffer needed.
- lpPrinterName
- This is used only if nPrtMode is set to SpecificPrinter. It
is ignored otherwise. This is a null-terminated string containing
the printer name. If the printer does not exist, this member fails.
PrinterName must have the following format:
For example:<Printer name> on <Port Name>
IBM InfoPrint 40 PS on Network Port
HP LaserJet 4050 Series PCL 6 on LPT1
- ULONG * const pErrorInfo
- This is filled with the extended error info when the API fails
with the return code of PCS_FAILURE. pErrorInfo must be set to NULL
by the caller, if the details of errors are not needed.
The following section describes the flags that are defined in PCSAPI32.H.