For Programmers: Free Programming Magazines  


Home > Archive > VC Language > May 2006 > Need help on TCHAR









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Need help on TCHAR
gshy2014@gmail.com

2006-05-24, 4:16 am

IN Windows, TCHAR is translated to be wchar or char according to
whether UNICODE is defined. At compile time, does the compiler detect
the OS type and turn on /DUNICODE? Or the programmers need do this job
themselves to determined how to translate the TCHAR?

David Wilkinson

2006-05-24, 8:09 am

gshy2014@gmail.com wrote:

> IN Windows, TCHAR is translated to be wchar or char according to
> whether UNICODE is defined. At compile time, does the compiler detect
> the OS type and turn on /DUNICODE? Or the programmers need do this job
> themselves to determined how to translate the TCHAR?
>


gshy:

It has nothing to do with the OS (remember the OS's on the development
machine and the target machine may be different). You must define
UNICODE (and _UNICODE) either in your project headers or in your code.

A Windows program compiled with UNICODE and _UNICODE defined will only
run on Windows NT/2000/XP/2003/Vista (unless you use a thing called
MSLU). A program compiled without UNICODE and _UNICODE will run on any
platform, but will typically only be able to use characters that are in
the local code page.

David Wilkinson
Laurant

2006-05-26, 8:07 am

David Wilkinson: Thank you very much

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com