Yes. Use std::wstring, as the error message does say. However, you should use CString::Format() instead of stringstream.
If you use MFC, do it the MFC way.
You can't pass a std::wstring as argument to CEdit->SetWindowText, as you are trying to do. Use c_str() member as this:
pedit->SetWindowText(element.c_str()); // Second error HERE
As for the first error, you cannot use const char* as argument of std::wstring constructor, as you do in this line:
element = fos.str().c_str(); // First error HERE.
fos is a ostringstream type, but you need to be of type