title: Why do I get invalid data in my CString formatted using Format()?
body: <pre><code>LRESULT CFlashWnd::OnScannerProgress( WPARAM wParam, LPARAM lParam )
  {
      ScannerProgress *pEvent = (ScannerProgress *)wParam;
  
      CString scannerAreaText = _T("");
      scannerAreaText.Format(_T("&lt;B&gt;Scanning%3A&lt;/B&gt; &lt;font face='Arial' size='10'&gt;%s&lt;/font&gt;"), pEvent-&gt;pszScanner);
  
      CString scanProgressText = _T("");
      scanProgressText.Format(_T("&lt;B&gt;Scan Progress%3A&lt;/B&gt; &lt;font face='Arial' size='10'&gt;%f&lt;/font&gt;"), pEvent-&gt;dwScanPercent);
  
      CString scanProgressBarValue = _T("");
      scanProgressBarValue.Format(_T("%f%"), pEvent-&gt;dwScanPercent);
  
      if(pEvent-&gt;pszScanItem)
          free((void *)pEvent-&gt;pszScanItem);
  
      if(pEvent-&gt;pszScanner)
          free((void *)pEvent-&gt;pszScanner);
  
      delete pEvent;
  
      return 0;
  }
  </code></pre>
  
  <p>I keep getting funky values and/or crashes. Any suggestions are welcome.</p>