If you want to compile in legacy MBCS mode, you can use ATL / MFC string conversion helpers , for example CW2T , for example:
MessageBox( CW2T(e.getAllExceptionStr().c_str()), _T("Error initializing the sound player") );
It seems your getAllExceptionStr() method returns std::wstring , so calling .c_str() on it returns const wchar_t* .
CW2T converted from wchar_t -string to TCHAR -string, which in your case (considering MBCS compilation mode) is equivalent to char -string.
Note, however, that conversions from Unicode ( wchar_t -strings) to MBCS ( char strings) may be lost.
source share