简体   繁体   English

在VS 2013中弃用MBCS对MFC的支持的副作用

[英]Side-effect of deprecation of MBCS support for MFC in VS 2013

I just tried to compile an old MFC app under VS2013. 我只是试图在VS2013下编译一个旧的MFC应用程序。 It complained that non-Unicode MFC applications were deprecated, and refused to compile. 它抱怨非Unicode MFC应用程序已被弃用,并拒绝编译。 Which is somewhat contrary to this announcement that talks about deprecating support for MBCS. 这与本新闻稿中谈论过时的MBCS支持已过时有些相反。 Until now there were three choices for the Character Set option: 到目前为止,“字符集”选项有三个选择:

  • Unicode 统一
  • MBCS MBCS
  • Not set 没有设置

Personally, I'm entirely comfortable with dropping support for MBCS - I neither want nor need MBCS. 就我个人而言,我完全不愿意放弃对MBCS的支持-我既不需要MBCS,也不需要MBCS。 But nor do I want nor need Unicode - ANSI/ASCII is just fine by me. 但是我也不想要Unicode-我觉得ANSI / ASCII很好。 So insisting that every MFC application henceforth must speak Unicode, and (in effect) provide the foundations of a platform support all possible languages, no matter who its intended audience is, seems... extreme. 因此,坚持要求每个MFC应用程序今后都必须使用Unicode,并且(实际上)提供平台支持所有可能的语言的基础,无论其目标受众是谁,这似乎都是极端的。 Am I missing something? 我想念什么吗? Should I still be able to compile an MFC application with no character set specified under VS2013? 在VS2013下没有指定字符集的情况下,我仍然可以编译MFC应用程序吗?

You can. 您可以。 Currently all my programs use the Unicode library. 目前,我所有的程序都使用Unicode库。 Except one older one, that includes very old code from previous versions and this program is needed for update support for this od version... 除了一个较旧的版本以外,其中包括以前版本中非常旧的代码,并且此程序需要此程序才能对此od版本进行更新支持...

  1. Currently there is an Addon that still supports MBCs. 当前有一个Addon仍支持MBC。
  2. Vote for it 为它投票
  3. As I understand the discussion (see comment of Mark Davis dated December 2014) such an Addon will be available up and including VS2015 (whatever Version is meant). 据我了解的讨论(请参阅2014年12月Mark Davis的评论),此类插件将可用,包括VS2015(无论是什么版本)。

To be more precise what happens when you select "None" for the character set: 更准确地说,当您为字符集选择“无”时会发生什么:

  1. You program is linked against the MBCS Version of the MFC 您的程序链接到MFC的MBCS版本
  2. Also the Windows SDK will Default to the MBCS Version of the API. 同样,Windows SDK将默认为API的MBCS版本。 So ie GetWindowTextA is calls instead of GetWindowTextW 因此,即调用GetWindowTextA而不是GetWindowTextW

So in fact. 所以实际上。 Setting _UNICODE and _MBCS to nothing just Defaults to _MBCS... 仅将_UNICODE和_MBCS设置为无,默认为_MBCS ...

Internally the SDQ always checks a if UNICODE (not _UNICODE) is set. 在内部,SDQ始终检查是否设置了UNICODE(而非_UNICODE)。 If not the MBCS Version is chosen. 如果不是,则选择MBCS版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM