All Forums
 Microsoft Windows CE
 eVC Application Development
 TEXT, _T and L explained
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 17 Mar 2003 :  13:36:44  Show Profile  Email Poster
Q: In your sample code sometimes you use TEXT, sometimes _T and sometimes L as a prefix to strings. What do these functions do and why the differences?

Windows CE uses Unicode strings and cannot accept ANSI strings to any function that uses a string. _T and TEXT are macros that convert ANSI strings to Unicode. If you look at the definitions of _T and TEXT you'll find this:

tchar.h
#define _T(x) __TEXT(x)

winnt.h
#define TEXT(quote) __TEXT(quote)


Meaning there are the same. In fact using the L macro also does the same, so all of these are equal:

_T("Hello World")
TEXT("Hello World")
L"Hello World"


It's just a matter of personal preference and style. You'll see all of them throughout ADS sample code depending largely on the developer who wrote it.
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000