Enumerate serial ports
'--------------------------------------------------------------------- ' Visual Basic 6 Example '--------------------------------------------------------------------- On Error GoTo ErrorHandler Dim i As Integer Dim nPorts As Integer Dim PortName As String nPorts = FTSPCControl1.EnumSerialPorts() For i = 0 To nPorts PortName = FTSPCControl1.GetSerialPort(i) ' Todo: add your code Next i Exit Sub ErrorHandler: Dim err_code As Integer err_code = FTSPCControl1.GetLastError MsgBox "ErrorCode = " & CStr(err_code) & " - " & _ Err.Description, vbCritical, "Error!" ///////////////////////////////////////////////////////////////////// // C++ Example ///////////////////////////////////////////////////////////////////// CString PortName; try { long nPorts = m_SPCControl1.EnumSerialPorts(); for (int i = 0; i < nPorts i++) { PortName = m_SPCControl1.GetSerialPort(i); // Todo: add your code } } catch(COleDispatchException* E) { MessageBox(E->m_strDescription, mbCaption, MB_OK | MB_ICONERROR); }