Index: Connect.cs =================================================================== --- Connect.cs (revision 41291) +++ Connect.cs (working copy) @@ -94,6 +94,12 @@ else pipeName = PipeNameTextBox.Text; + if (Type == ConnectionType.Serial && !cPort.Enabled) + { + MessageBox.Show("Could not find any useable serial port. Use an other connection interface.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); + return; + } + if (cType.SelectedItem.ToString().CompareTo("Client") == 0) pipeMode = ConnectionMode.MODE_CLIENT; else if (cType.SelectedItem.ToString().CompareTo("Server") == 0) @@ -112,13 +118,24 @@ int i = 0; /* Serial */ - foreach (string s in SerialPort.GetPortNames()) + string[] serialPorts = SerialPort.GetPortNames(); + if (serialPorts == null || serialPorts.Length == 0) { - cPort.Items.Add(s); + cPort.Enabled = false; + cBaud.Enabled = false; + tabSerial.Text = "Serial (unavailable)"; } - SelectComboItem(cPort, Settings.ComPort); - SelectComboItem(cBaud, Settings.Baudrate); + else + { + foreach (string s in serialPorts) + { + cPort.Items.Add(s); + } + SelectComboItem(cPort, Settings.ComPort); + SelectComboItem(cBaud, Settings.Baudrate); + } + /* Pipe */ DefaultRadioBtn.Text += " [" + defaultPipeName + "]"; for (i = 0; i < cType.Items.Count - 1; i++) Index: MainWindow.cs =================================================================== --- MainWindow.cs (revision 41291) +++ MainWindow.cs (working copy) @@ -306,6 +306,8 @@ switch (newConnection.Type) { case Connect.ConnectionType.Serial: + if (String.IsNullOrEmpty(newConnection.ComPort)) + return; mConnection.StartSerial(newConnection.ComPort, newConnection.Baudrate); break; case Connect.ConnectionType.Pipe: