CString -> TCHAR 
Author Message
 CString -> TCHAR

Does anyone know how to convert a CString value into a
TCHAR?

Thanks,
Andrew



Mon, 12 Sep 2005 19:40:46 GMT  
 CString -> TCHAR

Quote:
>-----Original Message-----
>Does anyone know how to convert a CString value into a
>TCHAR?

>Thanks,
>Andrew
>.
>you cannot convert it to TCHAR. you can type cast it to a

const char *. I had to use CString to call
CStdioFile::ReadString(cstr). Then i type casted it to
(LPCTSTR) so that i could use sscanf.

good luck.  cstring is so anoying.



Mon, 12 Sep 2005 20:25:24 GMT  
 CString -> TCHAR
You can use the operator LPCTSTR if you dont want to modify the CString. If
you want to modify it, use GetBuffer/ReleaseBuffer.

On other note, If you are using MBCS build(not UNICODE), TCHAR is same as
char.

--
Ajay Kalra [MVP - VC++]


Quote:
> Does anyone know how to convert a CString value into a
> TCHAR?

> Thanks,
> Andrew



Mon, 12 Sep 2005 21:26:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to convert CString into TCHAR*

2. cstring vs. tchar/char array

3. Copy CString to TCHAR

4. TCHAR Array to CString

5. TCHAR to CString ?

6. CString to TCHAR*,int,long

7. CString to TCHAR and vice versa?

8. Need Help on map <TCHAR*, long>

9. How can I cin >> Cstring

10. How to covert CString to TCHAR and CString to LPCWSTR?

11. B>C>C++>VC++(MFC)>RAW API PROGRAMMING>ATL>COM>OLE>ADO>ASP.............

12. >>>>>>>>> What would you like in a debugger?

 

 
Powered by phpBB® Forum Software