本文介绍了在VS 2013中弃用MBCS对MFC的支持的副作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是试图在VS2013下编译一个旧的MFC应用程序.它抱怨非Unicode MFC应用程序已被弃用,并拒绝编译.这有点与此公告,该公告讨论过时的MBCS支持.到目前为止,字符集"选项有三个选择:

I just tried to compile an old MFC app under VS2013. It complained that non-Unicode MFC applications were deprecated, and refused to compile. Which is somewhat contrary to this announcement that talks about deprecating support for MBCS. Until now there were three choices for the Character Set option:

  • Unicode
  • MBCS
  • 未设置

就我个人而言,我完全不愿意放弃对MBCS的支持-我既不需要MBCS,也不需要MBCS.但是我也不想要Unicode-我觉得ANSI/ASCII很好.因此,坚称从此以后每个MFC应用程序都必须使用Unicode,并且(实际上)为支持所有可能的语言提供了平台的基础,无论其目标受众是谁,这似乎都是极端的.我想念什么吗?在VS2013下没有指定字符集的情况下,我仍然能够编译MFC应用程序吗?

Personally, I'm entirely comfortable with dropping support for MBCS - I neither want nor need MBCS. But nor do I want nor need Unicode - ANSI/ASCII is just fine by me. 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. Am I missing something? Should I still be able to compile an MFC application with no character set specified under VS2013?

推荐答案

可以.目前,我所有的程序都使用Unicode库.除了一个较旧的版本以外,其中包括以前版本中非常旧的代码,并且需要此程序才能对此od版本进行更新支持...

You can. Currently all my programs use the Unicode library. Except one older one, that includes very old code from previous versions and this program is needed for update support for this od version...

  1. 当前有一个插件仍支持MBC.
  2. 为此投票
  3. 据我所了解的讨论(请参阅2014年12月Mark Davis的评论),此类插件将可用,包括VS2015(无论是什么版本).
  1. Currently there is an Addon that still supports MBCs.
  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).

更准确地说,当您为字符集选择无"时会发生什么:

To be more precise what happens when you select "None" for the character set:

  1. 您的程序已与MFC的MBCS版本链接
  2. Windows SDK还将默认为API的MBCS版本.因此,即调用GetWindowTextA而不是GetWindowTextW

实际上.仅将_UNICODE和_MBCS设置为空,默认为_MBCS ...

So in fact. Setting _UNICODE and _MBCS to nothing just Defaults to _MBCS...

在内部,SDQ始终检查是否设置了UNICODE(而不是_UNICODE).如果未选择,则选择MBCS版本.

Internally the SDQ always checks a if UNICODE (not _UNICODE) is set. If not the MBCS Version is chosen.

这篇关于在VS 2013中弃用MBCS对MFC的支持的副作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-04 10:40