title: -Error reading characters of string
body: <p>I have the following block of code:</p>
  
  <pre><code>for( CarsPool::CarRecord &amp;record : recs-&gt;GetRecords())
  {
    LVITEM item;
    item.mask = LVIF_TEXT;
    item.cchTextMax = 6;
  
    item.iSubItem = 0;
    item.pszText = (LPSTR)(record.getCarName().c_str()); //breakpoint on this line.
    item.iItem = 0;
    ListView_InsertItem(CarsListView, &amp;item);
  
    item.iSubItem = 1; 
    item.pszText = TEXT("Available");
    ListView_SetItem(CarsListView, &amp;item);
  
    item.iSubItem = 2;
    item.pszText = (LPSTR)CarsPool::EncodeCarType(record.getCarType());
    ListView_SetItem(CarsListView, &amp;item);
  }
  </code></pre>
  
  <p>The information from Visual Studio Debugger is here:</p>
  
  <p><img src="https://i.stack.imgur.com/a23Uu.png" alt="enter image description here"></p>
  
  <p>Why isn't the program able to read the characters from string?</p>
  
  <p>A test has shown me that it works in this way:</p>
  
  <pre><code>MessageBox(hWnd, (LPSTR)(record.getCarName().c_str()), "Test", MB_OK);
  </code></pre>