FtVspcAttach Function
Attaches to virtual serial port with non-standard name.
FTVSPCHANDLE FtVspcAttach( LPCTSTR lpszPortName, LPFNVSPCPORTEVENTS lpfnOnEvent, LONG_PTR Context );
Parameters
lpszPortName
[in] Virtual serial port name. The name should be the same that previously used in FtVspcCreatePort.
lpfnOnEvent
[in] A pointer to the function to call on port event (cannot be NULL). Refer to FtVspc_PortEvent.
Context
[in] User context (any value).
Return Value
Handle of virtual serial port (0, if cannot attach to the port). This value is not system handle, it is internal Virtual Serial Port Control handle.
Errors
ftvspcErrorFailed | 1 | The operation has not been completed. |
---|---|---|
ftvspcErrorInvalidParameter | 2 | Invalid parameter. |
ftvspcErrorNoSuchPort | 101 | There is no such port. |
ftvspcErrorPortAttached | 200 | This port is already attached. |
ftvspcErrorMarkedForDeletion | 202 | This port is marked for deletion. |