在我的代码中定义unicode后,似乎并未在所有文件中都定义unicode. [英] unicode doesn't seem to be defined in all files after it's defined in my code.
问题描述
正如标题所述,我正在尝试制作一个仅通过定义UNICODE就可以轻松利用unicode或ANSI的程序. TCHAR就是为此而设计的,如果它们可以工作,我真的很想使用它们.显然,当此代码在这里时:
As title says, i''m attempting to make a program that can utilize either unicode or ANSI easily with just the defining of UNICODE. TCHAR''s were made for this, and i would really like to use them if only they would work. apparently, when this code here:
#ifndef _UNICODE
#define _UNICODE
#endif
#ifndef UNICODE
#define UNICODE
#endif
定义UNICODE,标题,winNT.h仍然拒绝将T字符串解析为unicode.我知道定义是可行的,因为我所有的函数宏现在都可以解析为宽字符对应的宏.虽然当T字符串解析为ANSI时并没有太多用处.
defines UNICODE, the header, winNT.h still refuses to make T-strings resolve to unicode. I know the definition works though because all my function macros now resolve to their wide character counterparts. Not much use though when T strings resolve to ANSI. Any idea what''s up here?
推荐答案
像_UNICODE这样的全局宏的最大问题之一是在没有其他任何东西之前就对其进行了定义...
在命令行/预处理程序定义中定义它可能会更有效
One of the biggest problems with global macros like _UNICODE is defining it before anything else gets in ...
it''s probably going to more effective to define it on the command line/preprocessor defines
这篇关于在我的代码中定义unicode后,似乎并未在所有文件中都定义unicode.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!