PortName Property
Returns the name of the port ("COM1", "COM2", etc.).
Syntax
Visual Basic
object.PortName
Visual C++
object.GetPortName()
| Part
| Description |
| object |
An object expression that evaluates to a GPS ToolKit object. |
Example
Visual Basic
'Get port name
Dim portName As String
portName = myGPSToolKit.PortName
Visual C++
_variant_t vtPortName;
// Get port name
vtPortName = m_myGPSToolKit.GetPortName();
_bstr_t convBSTR = (_bstr_t)vtPortName;
CString strPortName = (LPCSTR)convBSTR;
Remarks
None
Returns
A VARIANT (type VT_BSTR/BSTR/VB String) containing the name of the open port.
Errors
Reading the PortName property while the port is closed is not permitted
and will cause GPS ToolKit to throw a "Port is closed" exception.
See Also
Open(), PortHandle
|