If I have this below unsigned char* data
'xxxxxxxx' (assume x is Ascii Character)
How to change from unsigned char* to CString and how to change back from CString to unsigned char*.
Do you know how to do that?
Thank you for your answer.
If I have this below unsigned char* data
'xxxxxxxx' (assume x is Ascii Character)
How to change from unsigned char* to CString and how to change back from CString to unsigned char*.
Do you know how to do that?
Thank you for your answer.
Last edited by ooosawaddee3; 11-07-2002 at 02:23 PM.
Few ways to do it.....here's a few
Dont forget that CString's operator=() will take normal char strings for assignment...Code:TCHAR *buff = "Hello World"; MessageBox(buff); CString str; str = buff; MessageBox(str); TCHAR *buff2 = new TCHAR[str.GetLength()+1]; if(buff){ _tcscpy(buff2,str); MessageBox(buff2); }
And its operator LPCTSTR() allows you to use string copy functions