Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

from TCHAR to char

Status
Not open for further replies.

TheMillionDollarMan

Programmer
Jun 10, 2002
132
0
0
US

How can I go from a TCHAR to a char..?

I have tried everything...
CString s.GetBuffer(0) etc..

MSVC6.0 and W2k.
Thanks
D
 
Look up the definition of TCHAR by right clicking on it and selecting "Go to definition". A TCHAR should be the same thing as a char and no conversion should be necessary.
 
Depends whether UNICODE is defined. If UNICODE is defined TCHAR is wchar_t otherwise it is char. Problem is wchar is both Unicode and MBCS. Not sure how you convert between the two.

If you wish to have it as a char array, cast a pointer to it.

Also, Unicode TCHAR is 16 bits on Microsoft and 32 bits on some Unix platforms. Think very carefully if you have multiple platforms.
 
you may use OemToChar and/or CharToOem

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top