how to convert CString to const WCHAR *
-
Hi Noname, this will help u http://www.codeproject.com/cpp/data\_conversions.asp Regards, Vinay Charan.
-
CString::GetBuffer(...);
CString csStr = _T( "Somestring" );
LPCTSTR szBuff = (LPCTSTR)csStr;
LPTSTR szBuff1 = csStr.GetBuffer();LPTSTR
andLPCTSTR
areWCHAR*
andCONST WCHAR*
type respectively.
Nibu thomas A Developer Programming tips[^] My site[^]
-
wchar_t *pwsz1=NULL; CString str; str="Hi"; pwsz1=str.AllocSysString(); ------------------------------------- WCHAR pwsz[1024]; CString Test2="Hi"; MultiByteToWideChar( CP_ACP,0,Test2,-1,pwsz,sizeof( pwsz)); ------------------------------------ WCHAR* pwsz2; CString Test3="Hi"; pwsz2=new (WCHAR); MultiByteToWideChar( CP_ACP, 0, Test3,-1, pwsz2, sizeof( pwsz2 ) );_**
**_
whitesky
-
NoName II wrote:
how to convert CString to const WCHAR *
mbstowcs
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV SupportCRY- Child Relief and You