Solved

__T()

Posted on 2000-03-08
2
369 Views
Last Modified: 2006-11-17
Hi.
VC has a macro: __T() that's suppose to make life easier when switching between unicode/mb builds.
What does it do? I thought it'l map to L on unicode builds, but according to the sources - it just maps to nothing.

What's up?
0
Comment
Question by:AssafLavie
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 2597667
You are right:

#define __T(x)      L ## x

the above line can be found in 'tchar.h' - the catch it that

#define __T(x)      x

This is controlled by the 'UNICODE' symbol that has to be defined or not, depending on what you want to use. In short:

#ifdef UNICODE
#define __T(x)      L ## x
#else
#define __T(x)      x
#endif

('tchar.h' boiled down to '__T()' ;-)

Feel free to ask if you need more information
0
 
LVL 4

Author Comment

by:AssafLavie
ID: 2597894
Hmm yea.
I guess I missed that #if in the source file.
Thanks.
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question