GetPhysical Method
Retrieves the name of physical serial port by index.
Syntax
| Visual Basic | Function GetPhysical(Index As Long) As String |
|---|---|
| Delphi | function GetPhysical(Index: Integer): String; |
| Visual C++ (MFC) | CString GetPhysical(LONG Index); |
| Visual C++ (#import) | _bstr_t GetPhysical(LONG Index); |
Parameters
Index
[in] Index of physical serial port (0 ... unPortsCount - 1). Refer to EnumPhysical.
Return
Returns the number of physical serial port by index.
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). |
Remarks
You must call EnumPhysical before calling this function.