title: Serial port C++ problem
body: <p>I have a problem connecting to any serial port (want to exchange with an Arduino) using c++ on visual studio.</p>
  
  <p>I'm using the <a href="http://www.arduino.cc/playground/Interfacing/CPPWindows" rel="nofollow">SerialClass</a> given in the Arduino playground, but can't open an handle to my port. It throws ERROR_FILE_NOT_FOUND on every try..</p>
  
  <p>I've been testing many other ways of notating the port:</p>
  
  <pre><code>"COM1"
  "COM1:"
  "\\.\COM1"
  </code></pre>
  
  <p>but nothing's working.</p>
  
  <p>The port is availiable on the system, and working fine using Putty or the Arduino IDE. Additionally it isn't blocked by other processes.</p>
  
  <p>I'm using Windows 7 x64, but project is Win32.</p>
  
  <p>The class is constructed with</p>
  
  <p><code>serialPort = new Serial((char*)port);</code></p>
  
  <p>and the error string shows the right portname.</p>
  
  <p>What I'm doing wrong?</p>
  
  <p><strong>File opening isn't working, too.</strong></p>