   Going from std string to LPCWSTR C++
  Using MS speech sdkDoing thisVoice -> Speak ( L"Hello", SPF_DEFAULT, NULL );worksdoing thisstring HelloStr = "Hello";Voice -> Speak ( (LPCWSTR)HelloStr.c_str(), SPF_DEFAULT, NULL );failsresult is the voice kind of cuts offtried different phrases and seems like it's not getting properly in there..any ideas?   
  Did you try using a std::wstring instead? wstring HelloStr = L"Hello";   ;  Just for clarification, NEVER cast a string type. There are situations where you need to but then you'll know it.The L prefix is not a cast, it's a special prefix that tells the compiler to make a wide char literal of the following text.A LPCWSTR is a Long Pointer to a Constant Wide char String. c_str() of a std::string returns a const char* (Windows typedef'ed to LPCSTR).If your source is a std::string you need to convert it to a std::wstring properly and then use c_str().std::wstring ToStringW( const std::string& strText ){  std::wstring wstrResult;  wstrResult.resize( strText.length() );  typedef std::codecvt<wchar_t, char, mbstate_t> widecvt;  std::localelocGlob;  std::locale::global( locGlob );  const widecvt& cvt( std::use_facet<widecvt>( locGlob ) );  mbstate_t   State;  const char*  cTemp;  wchar_t*    wTemp;  cvt.in( State,&strText[0], &strText[0] + strText.length(), cTemp,(wchar_t*)&wstrResult[0], &wstrResult[0] + wstrResult.length(), wTemp );   return wstrResult;}