您的位置:首页 > 其它

一个ON_COMMAND_RANGE( id1, id2, memberFxn ) 函数引起的困惑

2011-12-02 10:38 573 查看
最近编写一个图像处理软件,引用前人的一些源码后,出现了添加的菜单变灰无法使用的情况,我反复的追踪源码,找了好久才终于找到一个和菜单关系很大的函数ON_COMMAND_RANGE( id1, id2, memberFxn ) ,MSDN上是这样对这个函数解析的
ON_COMMAND_RANGE( id1, id2,
memberFxn )

Parameters
id1
Command ID at the beginning of a contiguous range of command IDs.
id2
Command ID at the end of a contiguous range of command IDs.
memberFxn
The name of the message-handler function to which the commands are mapped.
Remarks
Use this macro to map a contiguous range of command IDs to a single message handler function. The range of IDs starts with
id1 and ends with id2.

我发现代码里面的id1和id2有很大的疑点,之后就追踪这两个id到rc文件里面,终于在id里面发现了问题的根源,我把没有考虑到两个id的顺序,把第一个命令的id放在前面,最后一个放在后面,运行后,就得出了正确结果。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: