像“afx_msg"这样的东西吗?VS/MFC 仍在使用装饰器? [英] Are things like "afx_msg" decorators still used by VS/MFC?

查看:12
本文介绍了像“afx_msg"这样的东西吗?VS/MFC 仍在使用装饰器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个 MFC 程序,该程序早在 VC6 时代就开始了.当时有一个类向导,它使用一堆装饰器和注释中的标记来解析类文件.

I'm working on an MFC program that started way back in the VC6 days. Back then there was a class wizard that used a bunch of decorators and markup in comments to parse class files.

例如,它会在它维护的消息处理程序前面插入 afx_msg.它会用 //{{AFX_MSG_MAP(TheApp)/}}AFX_MSG_MAP 注释标记一段代码,以帮助它找到它想要处理的消息映射部分.

For example, it would insert afx_msg in front of message handlers that it maintained. It would mark a block of code with //{{AFX_MSG_MAP(TheApp) and /}}AFX_MSG_MAP comments to help it find the parts of the message map it wanted to handle.

AFAIK,这不再需要了.除此之外,类向导还有很多缺点,我们不得不对这些托管块进行大量手动编辑,而且我们从来没有经常使用它.

AFAIK, this isn't needed anymore. Besides that, there were so many shortcomings with the class wizard that we had to do a lot of manual editing of these managed blocks and we never used it very often anyways.

还有其他理由继续使用 afx_msg 及其同类产品吗?

Are there any other reasons to keep using afx_msg and its ilk?

推荐答案

afx_msg 仍然存在,但一直是纯粹的信息.正如你所说的装饰师.它一直被#定义为空字符串.

afx_msg still exists but has always been purely informative. A decorator as you put it. It's always been #defined as an empty string.

自 VS2003 起不再需要 {{ 和 }} 标记:VS 现在足够聪明,可以将内容放在正确的位置,而无需依赖这些标记.您会注意到 VS2003+ 在它创建的项目中不再包含这些行.

the {{ and }} markers are no longer needed since VS2003: VS is now smart enough to put things in the right place without having to rely on these markers. You'll notice that VS2003+ no longer includes these lines in the projects it creates.

这篇关于像“afx_msg"这样的东西吗?VS/MFC 仍在使用装饰器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆