title: CreateFile() returns INVALID_HANDLE_VALUE (C++)
body: <p>Consider:</p>
  
  <pre><code>void main()
  {
      LPSTR FileName;
      FileName = "C:\\test2.wav";
      hFile = CreateFile((LPCWSTR)FileName, GENERIC_READ, 0, 0,
                         OPEN_EXISTING, FILE_ATTRIBUTE_ARCHIVE, 0);
      if (hFile == INVALID_HANDLE_VALUE)
      {
          cout &lt;&lt; "INVALID_HANDLE_VALUE" &lt;&lt; endl;
          return;
      }
  }
  </code></pre>
  
  <p>This program always prints "INVALID_HANDLE_VALUE". Why? File <code>C:\test2.wav</code> exists.</p>