This function retrieves the printer port.
[C++Builder] DWORD
IKGetPrinterPort(LPCTSTR PrinterName, LPTSTR Port);
[Delphi] function
IKGetPrinterPort(PrinterName, Port: PChar): DWORD;
Parameters
Name | Explanation |
---|---|
PrinterName | The printer name |
Port | The retrieved printer port |
Return Value
If successful, returns the length of the string set in the Port parameter (not including the terminating "null"). Returns 0 if unsuccessful.
Explanation
The IKGetPrinterPort function retrieves the printer port. Before executing this function, the printer name must be set in the PrinterName parameter. If the IKGetPrinterPort function is successful, the port name will be set in the Port parameter. If printers are using more than one port, the port names will be separated with a comma.
Example: "LPT1:,LPT2:"