GetVirtual Method

Retrieves virtual serial port name by index.

Syntax

Visual Basic
Function GetVirtual(Index As Long, MarkedForDeletion As Boolean) As String 
Delphi
function GetVirtual(Index: Integer, var MarkedForDeletion: Boolean): String; 
Visual C++ (MFC)
CString GetVirtual(LONG Index, BOOL *MarkedForDeletion);
Visual C++ (#import)
_bstr_t GetVirtual(LONG Index, VARIANT_BOOL *MarkedForDeletion);

Parameters

Index

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

MarkedForDeletion

[out] 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.

Errors

The method may throw exception. Use GetLastError method to get the error code.

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

See Also

EnumVirtual