FtVspcGetVirtualNum Function

Retrieves virtual serial port number by index.

BOOL FtVspcGetVirtualNum(
	UINT unIndex,
	UINT* lpunPortNo,
	BOOL* lpbMarkedForDeletion 
	);

Parameters

unIndex

[in] Index of virtual serial port (0 ... unPortsCount - 1). Refer to FtVspcEnumVirtual.

lpunPortNo

[out] A pointer to the variable where the number of virtual serial port is returned (e.g 1 means COM1, 5 means COM5 and so on). If the number is -1, it means that the port name differs from "COMx" and the name should be retrieved by FtVspcGetVirtual.

lpbMarkedForDeletion

[out] A pointer to the variable where MarkedForDeletion property of virtual serial port is returned. If TRUE, the port is marked for deletion (but it cannot be deleted because it is open by serial application). It will be removed on port close. FALSE otherwise.

Return Value

If the function succeeds, the return value is TRUE. Otherwise, use FtVspcGetLastError to get the error code (FtVspc_ErrorCode).

Errors

ftvspcErrorFailed 1 The operation has not been completed.
ftvspcErrorInvalidParameter 2 Invalid parameter.
ftvspcErrorNoMoreItems 102 There is no item (possible reason: index is too high).

See Also

FtVspcEnumVirtual, FtVspcGetVirtual