string listFile = "Path1"; string templateFile = "Path2"; wstring p1, p2; const wchar_t* listFile_new = (widen(listFile, p1)->c_str()); const wchar_t* templateFile_new = (widen(templateFile, p2)->c_str());
My "widen" function looks like this:
wstring* widen( const string& str, wstring& incomingString)
{
wostringstream wstm;
const ctype<wchar_t>& ctfacet =
use_facet< ctype<wchar_t> >( wstm.getloc() );
for( size_t i=0; i<str.size(); ++i )
wstm << ctfacet.widen( str[i] );
wstm << L"\n";
incomingString = wstm.str();
return &incomingString;
}
When I run my program in the debugger it seems like the conversion works okay, but when I check the value of listFile_new and templateFile_new, the de-referenced data seems to only include the first character of the string. I am sort of new to this type of conversion so if anyone has any input/ideas on what the problem might be I'd greatly appreciate it.
Thanks!

New Topic/Question
Reply



MultiQuote





|