是类似"afx_msg"的东西吗?仍然被VS/MFC使用的装饰器? [英] Are things like "afx_msg" decorators still used by 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仍然存在,但始终纯粹是有益的.如您所说的一个装饰器.它一直被#defined定义为空字符串.
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屋!