AddPort

  BOOL AddPort(pName, hWnd, pMonitorName)    
  LPSTR pName;    
  HWND hWnd;    
  LPSTR pMonitorName;    

This function allows a Port to be added to the system that a Printer can be connected to.

Parameters

pName

Specifies the name of the Server that a Port is to be added to. If NULL, then the Port is to be added locally.

hWnd

Specifies the Parent Window Handle that the Dialog box should be created with.

pMonitorName

Specifies the Monitor that should be used to add the Port. This name is retrieved by calling the EnumMonitors function.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. To obtain extended error information, use the GetLastError function.