Tuesday, June 16, 2009

convert wstring to wchar*

To convert std::wstring to wchar*  or LPWSTR the function is wstring.c_str() which returns wchar* This works fine in VC6 But in visual studio 2008(vc9) it returns garbage value. is there some other function to convert std::wstring to wchar*/LPWSTR.

Reference :- http://www.eggheadcafe.com/software/aspnet/33281579/convert-wstring-to-wchar.aspx