Go VS2010 in the property page, C + +---Preprocessor definition

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.