char ptr to wstring - Urgent!
Posted on 2003-12-01
the following code doesn't worK:
wchar_t *WcString = new wchar_t;
size_t Number = sizeof(m_pcRegName);
size_t NumberAffected = mbstowcs( WcString, m_pcRegName, Number );
wstring wsFilePath = WcString;
It will compile, but WcString won't have the desired value. m_pcRegName points to "C:\", which is translated into "???????..." by the mbstowcs function. What am I doing wrong? Is there any easy way of doing this conversion?