The Attach method opens existing virtual serial port, previously created by CreatePort method

 

BOOL Attach(

      BSTR PortName     // name of the virtual serial port

);

 

Parameters:

  • PortName [in]: Name of the existing virtual serial port to be opened.

Return Values : If the function succeeds, the return value is TRUE. If the virtual serial port does not exist or no virtual serial bus is present in your system or virtual serial port is already assigned to another instance of VSP AX Control, the return value is FALSE.

Note: Use this method when you need to re-establish connection with existing virtual serial port, which was previously created by another instance of the control and connection was lost (your application exited without deleting virtual serial port).
Tip: See also: CreatePort method