title: LPBYTE data to CString in MFC
body: <p>I am encrypting data using CryptProtectData function and I am getting encrypted data in LPBYTE format, I want to save that data into a file and then read back for decryption.</p>
  
  <p>In order to write string in file, I used following one to convert LPBYTE data to CString:</p>
  
  <p>CString strEncrUName = (wchar_t *)encryptedUN;</p>
  
  <p>I even tried this one <a href="https://stackoverflow.com/questions/3714964/how-to-convert-from-byte-array-to-cstring-in-mfc">How to convert from BYTE array to CString in MFC?</a> but still it's not working.</p>
  
  <p>Character set used is unicode.</p>
  
  <p>Thanks in advance</p>