title: Windows API ReadFile() skips one out of every two characters
body: <p>My aim is to read all the text located in a file. For some reason whenever I read from the file and print the result (drawText), the buffer seems to be skipping one character every two positions. HELLO will become HLO and SCAVENGER becomes SAEGR.</p>
  <p>This is for Windows API. I wonder if CreateFile() and ReadFile() are just fine and whether it's something else causing the issue.</p>
  <pre><code>void init(HDC hdc)
  {
      HANDLE hFile;
      LPCSTR fileName = &quot;c:\\Users\\kanaa\\Desktop\\code\\HW2_StarterCode\\words.txt&quot;;
      hFile = CreateFileA(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
      DWORD dwFileSize = GetFileSize(hFile, NULL);
      DWORD dwBytesRead;
      WCHAR* buffer = new WCHAR[dwFileSize / 2 + 1];  
      buffer[dwFileSize / 2] = 0;
      bool read = ReadFile(hFile, buffer, dwFileSize, &amp;dwBytesRead, NULL);
      std::wstring wstr(buffer);
      std::string str(wstr.begin(), wstr.end());
      delete[] buffer;
      CloseHandle(hFile);
      if (read) parse(str, hdc);
  }
  
  void parse(std::string word, HDC hdc)
  {
      std::string to = word;
      std::wstring wword = std::wstring(to.begin(), to.end());
      const WCHAR* wcword = wword.c_str();
      Graphics graphics(hdc);
      drawText(&amp;graphics, wcword);
  }
  </code></pre>