AddPort

BOOL (WINAPI *pfnAddPort)(

    LPWSTR pName,

    HWND hWnd,

    LPWSTR pMonitorName

   );

AddPort creates a port and adds it to the list of ports currently supported by the specified monitor in the spooler environment.

Parameters

pName
Points to a zero-terminated string that specifies the name of the server to which the port is connected. If pName is null, the port is local.
hWnd
Handle to the parent window of the dialog box in which the port name will be entered.
pMonitorName
Points to a zero-terminated string that specifies the monitor associated with the port.

Return Value

The return value is TRUE if the function is successful, and FALSE otherwise.

Comments

The spooler calls AddPort when it receives an application request to add a port to its environment. The spooler forwards the call to the named monitor on the named server.

AddPort allows a port to be added interactively. A monitor should prompt a user to enter the port name in a dialog box on the window associated with hWnd. AddPort should validate the entered port name by calling the Win32 EnumPorts function to ensure that no duplicate port names are added to the spooler environment. A monitor should also verify that the port is one that it supports.

The spooler does not support remote AddPort calls. Consequently, AddPort implementations can ignore the pName and pMonitorName parameters.

AddPort is a port management function that must be implemented by port monitors and LMPMs. Pure language monitors should not implement this function.

See Also

AddPortEx, DeletePort