title: Serial connection is opening all ports?
body: <p>I'm creating UART Interface with MFC, the interface include open connection, send message and receive message.
  I thought I had opened the port fine, after checking, my D9 connector is sitting over COM5, which opened successfully.
  The issue is that even changing the connection from COM5 to the unreasonable COM535, I still didn't received any errors</p>
  
  <p>I've tried several COM port, some reasonable and some not.</p>
  
  <p>This is how I initialize the connection to the bad COM:</p>
  
  <pre><code>Serial::Serial(CString &amp;commPortName, int bitRate)
  {
      commHandle = CreateFile(L"\\\\.\\COM535", GENERIC_READ|GENERIC_WRITE, 0,NULL, OPEN_EXISTING, 
          FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED , NULL);
  
      if(commHandle == INVALID_HANDLE_VALUE) 
      {
          throw("ERROR: Could not open com port");
      }
      else 
      {
          // set timeouts
          COMMTIMEOUTS cto = { MAXDWORD, 0, 0, 0, 0};
          DCB dcb;
          if(!SetCommTimeouts(commHandle,&amp;cto))
          {
              Serial::~Serial();
              throw("ERROR: Could not set com port time-outs");
          }
  
          // set DCB
          memset(&amp;dcb,0,sizeof(dcb));
          dcb.DCBlength = sizeof(dcb);
          dcb.BaudRate = bitRate;
          dcb.fBinary = 1;
          dcb.fDtrControl = DTR_CONTROL_ENABLE;
          dcb.fRtsControl = RTS_CONTROL_ENABLE;
  
          dcb.Parity = NOPARITY;
          dcb.StopBits = ONESTOPBIT;
          dcb.ByteSize = 8;
  
          if(!SetCommState(commHandle,&amp;dcb))
          {
              Serial::~Serial();
              throw("ERROR: Could not set com port parameters");
          }
      }
  }
  </code></pre>
  
  <p>When I connect to COM5 it's all good, but I expect to have an issue connecting to COM535 which I dont, and that's not how it should be.</p>