why is TCHAR defined as wchar_t

S

SteveK

I cannot for the life of me figure out how to TCHAR to be defined as an
unsigned char as it is in out 6.0 project.

I created a fresh VS 2003 project and played around with the settings and
still cannot get TCHAR to be defined as anything other than wchar_t

Here are the compiler options in my setting's command window:


/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /D "_AFXDLL" /Gm /EHsc
/RTC1 /MDd /J /GR /Fo"Debug/" /Fd"Debug/vc70.pdb" /FR"Debug/" /W4 /nologo /c
/Wp64 /ZI /TP


one of them must be causing TCHAR to be set to wchar_t

Does anyone know what it doing it?


Thank you very much.




#ifndef _TCHAR_DEFINED
typedef char TCHAR, *PTCHAR; // line 324 of WinNT.h
typedef unsigned char TBYTE , *PTBYTE ;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */
 
C

Charles F McDevitt

SteveK said:
I cannot for the life of me figure out how to TCHAR to be defined as an
unsigned char as it is in out 6.0 project.

I created a fresh VS 2003 project and played around with the settings and
still cannot get TCHAR to be defined as anything other than wchar_t

Here are the compiler options in my setting's command window:


/Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_MBCS" /D "_AFXDLL" /Gm /EHsc
/RTC1 /MDd /J /GR /Fo"Debug/" /Fd"Debug/vc70.pdb" /FR"Debug/" /W4 /nologo
/c /Wp64 /ZI /TP


one of them must be causing TCHAR to be set to wchar_t

Does anyone know what it doing it?


Thank you very much.




#ifndef _TCHAR_DEFINED
typedef char TCHAR, *PTCHAR; // line 324 of WinNT.h
typedef unsigned char TBYTE , *PTBYTE ;
#define _TCHAR_DEFINED
#endif /* !_TCHAR_DEFINED */

None of those options are causing TCHAR to be wchar_t.

Somewhere you've managed get something included that #defines UNICODE or
_UNICODE,
which says to set TCHAR to be wchar_t.
 
T

thatsalok

TCHAR is Defined in WinNt.h as
#ifdef UNICODE
#define TCHAR wchar_T
#else
#deifne TCHAR char
#endif

Check wheather your Project configuration is UNICOdE enabled by
mistake.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top