MFC 对话框的菜单项,点击非popup菜单项,没有反应

爱笑的阳光 2016-03-11 10:54:45
这个对话框有两个地方调用,其中一个地方调用之后,菜单项可以工作,点击之后进入处理程序,另外一个地方点击菜单项始终没有反应。
求大神解惑!!!!
...全文
175 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
爱笑的阳光 2016-03-16
  • 打赏
  • 举报
回复
没有找到解决办法,暂时结贴吧。
赵4老师 2016-03-11
  • 打赏
  • 举报
回复
因为另外一个地方所在的线程上下文中没有windows消息循环,我猜。
爱笑的阳光 2016-03-11
  • 打赏
  • 举报
回复
UPUPUPUPUPUPUPUPUPUPUPUP
赵4老师 2016-03-11
  • 打赏
  • 举报
回复
Setting a Breakpoint on a Message Received by a Windows Function You can set message breakpoints to stop the debugger when a particular WndProc function message is received. Note Message breakpoints work only on x86- or Pentium-based systems. To set a breakpoint on a message From the Edit menu, click Breakpoints. The Breakpoints dialog box appears. Click the Messages tab. In the Break At WndProc text box, type the name of the Windows function. If you are setting a breakpoint during a debug session, the list contains the exported functions in your project. In the Set One Breakpoint For Each Message To Watch list box, select the message. To set another breakpoint, press ENTER, and then repeat steps 3 and 4. The Breakpoints list displays the currently active breakpoints. Click OK to set the breakpoints. Note If you interrupt execution while Windows or other system code is running, the results can be unpredictable.
赵4老师 2016-03-11
  • 打赏
  • 举报
回复
用Spy++调试相应windows消息。
爱笑的阳光 2016-03-11
  • 打赏
  • 举报
回复
引用 2 楼 zhao4zhong1 的回复:
因为另外一个地方所在的线程上下文中没有windows消息循环,我猜。

另外您看,下面的图示大概的示例。
像撤销、复制等菜单项的事件处理都是正常的,但是像基本属性和高级属性这两项在其中一种情况下就无效。。。
爱笑的阳光 2016-03-11
  • 打赏
  • 举报
回复
引用 2 楼 zhao4zhong1 的回复:
因为另外一个地方所在的线程上下文中没有windows消息循环,我猜。
好像不是这样的,两个调用的地方都很类似,都是创建了一个对话框,然后所有权交给这个对话框,走的流程一模一样,好奇怪。 另外麻烦问一问,这种情况应该怎么调试呢,我猜可能是消息阻塞了。。。

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧