dAddPrinter

Adds the specified printer to the system.

 

BOOL   dAddPrinter( LPSTR szPrinterNameTmp,    LPSTR szPrinterPortTmp,

LPSTR szDriverNameTmp,         LPSTR szPrintProcessorTmp )

 

Input value: szPrinterName

The name of the printer to be added. The maximum number of characters is 220 characters, 31 or lower is recommended. The PRINTER_NAME cannot contain any of following characters: \,

Input value: szPrinterPort

Specifies the name of the port the printer will be connected to. The maximum number of characters is 246. The PORT_NAME cannot contain any of following characters: *?|

Input value: szDriverName

The name of the printer driver

Input value: szPrintProcessor

The name of the print processor

Return value

Returns 0 if the printer was successfully added,1 if the

printer is already installed, otherwise the function returns the occurred error code by calling the GetLastError() internally. The GetLastError() returns the last error code that has occurred in the system.

 

 

NOTE: The printer driver, the port and the print processor must be installed before calling the dAddprinter() function.

 

NOTE:  This function is outdated, no longer recommended.