LlGetPrinterFromPrinterFile

Syntax:

INT LlGetPrinterFromPrinterFile (HLLJOB hJob, UINT nObjType, LPCTSTR pszObjName, INT nPrinter, LPTSTR pszPrinter, LLPUINT pnSizePrn, _PDEVMODE pDM, LLPUINT pnSizeDm);

Task:

Queries the printer configuration from the printer configuration file of List & Label.

Parameter:

hJob: List & Label job handle

nObjType: LL_PROJECT_LABEL, LL_PROJECT_CARD or LL_PROJECT_LIST

pszObjName: File name of the project with file extension

nPrinter: Index of the printer to be queried (0=first, 1=second) If you pass values starting from 100 (e.g. in a loop until you receive LL_ERR_PARAMETER as return value) you can query the printer for the various layout regions (corresponding to their order being set in the Designer via 'Project > Page Setup'). If the project contains only one printer, nPrinter must be -1.

pszPrinter: Address of buffer for printer name. If this pointer is NULL and pnSizePrn is not NULL, the necessary size of the buffer will be stored in *pnSizePrn.

pnSizePrn: Address of variable with buffer size (Size in characters, therefore the doubled size in Bytes must be reserved for the Unicode API).

pDM: Address of buffer for the DEVMODE structure. If this pointer is NULL and pnSizeDm non-NULL, the necessary size of the buffer will be stored in *pnSizeDm.

pnSizeDm: Address of variable with buffer size.

Return Value:

Error code

Hints:

The DEVMODE structure is defined and described in the Windows API.

Due to the possibility to define layout regions in the Designer the practical benefit of this function has been quite limited. We recommend using the LL object model according to chapter Using the DOM-API (Professional/EnterĀ­prise Edition Only) to access the layout regions and the associated printers.

See chapter Important Remarks on the Function Parameters of DLLs concerning the buffer return value.

See also:

LlSetPrinterInPrinterFile