Hi All,
Bit of a bizarre title but I am trying to avoid problems in my software regarding the virtual Serial Port. A device that is being designed user a USB virtual com port. I am reading this using the Serial Port Complete Method
do
{
index += 1;
cboPort.Items.Add(nameArray[index]);
} while (!((nameArray[index] == myComPortName) || (index == nameArray.GetUpperBound(0))));
cboPort.Text = nameArray[0];
this method gets all the comm ports available and is rock solid. I am looking at putting the code in a function after the port has been closed and the device removed. This is to allow multiple devices that could be attached to the PC as it might be used as to interface a number of these units or a single at this stage. Will this code all ways stick the Virtual Com as the last as it appears to using the below method
do
{
index += 1;
cboPort.Items.Add(nameArray[index]);
} while (!((nameArray[index] == myComPortName) || (index == nameArray.GetUpperBound(0))));
cboBaudRate.Text = cboBaudRate.Items[0].ToString();
//cboPort.Text = nameArray[0];
maxsize = cboPort.Items.Count;
maxsize--;
LastVal = cboPort.Items[maxsize].ToString();
cboPort.Text = LastVal;
I trying to avoid "it works on my PC"
Glenn