如何强制Visual C ++ 2010 Express默认为TextOut等ASCII版本的函数,而不是Unicode版本 [英] How can I force Visual C++ 2010 Express to default to the ASCII version of functions like TextOut instead of to the Unicode versions
问题描述
A
在Visual C ++学生版的腹部某处有一个类似头文件的东西,它将所有涉及文本的函数重新定义为Unicode版本,像 #define TextOut TextOutW。 我想这是普遍使用Unicode版本的计划的一部分。
当我重用20年前编写的代码时,我必须将所有这些函数,结构等转换为A版本,例如, TextOutA ,对于像我这样的老的,非常老的程序员来说,这更麻烦。
A
Somewhere in the belly of the student edition of Visual C++ there is something like a header file that redefines all of the functions that involve text to the Unicode versions, like #define TextOut TextOutW. I suppose it is part of the plan to get Unicode versions used universally.
When I reuse code I wrote 20 years ago, I have to convert all of these function,structures, etc., to the A versions, eg,TextOutA, It is more of a hassle than you would think for an old, really old, programmer like me.
推荐答案
查看项目属性对话框 - 在配置属性和常规下,有一个字符集选项。当设置为使用Unicode字符集时,预处理器定义UNICODE并设置_UNICODE,这就是您获得该函数的* W版本的原因。如果没有它,你应该得到ANSI版本。
Take a look in the project properties dialog - under "Configuration Properties" and "General" there is an option for "Character Set". When that is set to "Use Unicode Character Set" the preprocessor defines UNICODE and _UNICODE are set, which is why you get the *W version of the function. Without it set you should get the ANSI versions.
这篇关于如何强制Visual C ++ 2010 Express默认为TextOut等ASCII版本的函数,而不是Unicode版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!