VS2010 in the property page, C + +--and the preprocessor defines the time:2017-01-01 20:40:42 read:117 Comments:0 Favorites:0 [Point I collection +]
Tags: IMG WIN32 SDN/C + + implementation will ifdef mage
As in, here, WIN32, _debuge, _unicode and so on are actually some macro definitions, write these in here, equivalent to all the documents in this project are written:
#define Win32#define _DEBUG
#define _unicode
In this way, it is possible to achieve a multiple of the same code in different configuration environments in a compiled result file, thus achieving cross-platform. For example, in the VC, because the environment is Unicode, some are not, the same code in order to be used in both environments, then there will be the following macro definition (in fact, this is the code in TWHAR.H):
#ifdef _unicodetypedef wchar_t TCHAR; #define __T (x) l# #x # define _t (x) __t (x) #else # define __T (x) Xtypedef Char
Then, when you write Unicode in your environment, this section compiles:
#define __T (x) l# #x # define _t (x) __t (x)
If you do not write Unicode, then the above paragraph is not compiled, but the following is compiled:
#define __T (x) x
Thus, as long as your string uses _t ("Somechar"), then, when there is Unicode, it is L "Somechar", in the absence of Unicode at the time, it is itself "Somechar".
You can refer to this: http://blog.csdn.net/xiliang_pan/article/details/7081395
VS2010 in the property page, C + +---Preprocessor definition
Tags: IMG WIN32 SDN/C + + implementation will ifdef mage
Original: http://www.cnblogs.com/JMLiu/p/6241427.html
Go VS2010 in the property page, C + +---Preprocessor definition