CString to WCHAR
-
how can you convert a CString to a WCHAR? Thanks
-
how can you convert a CString to a WCHAR? Thanks
First of all there is no real comparison between CString and WCHAR. If you are compiling under _UNICODE then CString already contains string in WCHAR format. so... (LPCTSTR)strTest; // will return you string in WCHAR under _UNICODE. If you have not declared _UNICODE then you may need to use WideByteToMultibyte api... lookup in the MSDN for further information.
MSN Messenger. prakashnadar@msn.com "If history isn't good, just burn it." - Sidhuism.
-
First of all there is no real comparison between CString and WCHAR. If you are compiling under _UNICODE then CString already contains string in WCHAR format. so... (LPCTSTR)strTest; // will return you string in WCHAR under _UNICODE. If you have not declared _UNICODE then you may need to use WideByteToMultibyte api... lookup in the MSDN for further information.
MSN Messenger. prakashnadar@msn.com "If history isn't good, just burn it." - Sidhuism.
-
Mr.Prakash wrote: If you have not declared _UNICODE then you may need to use WideByteToMultibyte api... lookup in the MSDN for further information should be MultiByteToWideChar..
:doh: thank you.
MSN Messenger. prakashnadar@msn.com "If history isn't good, just burn it." - Sidhuism.