CMFCMenuButton没有显示下拉列表在发布 [英] CMFCMenuButton not showing dropdownlist in release

查看:153
本文介绍了CMFCMenuButton没有显示下拉列表在发布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在CDialogBar上有一个CMFCMenuButton,它有一个非常奇怪的行为:它在Debug构建中显示其下拉列表,但在发布版本中不显示。

I have a CMFCMenuButton on a CDialogBar that has a very strange behaviour: it shows its dropdown list in the Debug build but does not show it in the Release build.

Debug build:

Debug build:

发布版本:

似乎在OnShowMenu()的__super :: OnShowMenu()的调用中发生错误,我的派生类的方法。

It seems that there is happening something wrong in the call of __super::OnShowMenu() of the OnShowMenu() method of my derived class.

为了使事情变得更糟,我的机器上有一些配置没有进入MFC功能包方法...我做了一切把这个工作,我无法到达那里。

To make thing worse, there is some configuration on my machine that is not stepping into the MFC feature pack methods ... I made everything to put this working and I could not get there.

请帮助。

推荐答案

对不起,这是我的错误:

Sorry, it was my mistake:

在我的派生类OnShowMenu函数中,我不得不替换:

On my derived class OnShowMenu function, I had to replace:

pMyMenu= new CMenu;
ASSERT(pMyMenu->CreatePopupMenu());
this->m_hMenu= pMyMenu->GetSafeHmenu();

与此:

pMyMenu= new CMenu;
pMyMenu->CreatePopupMenu();
this->m_hMenu= pMyMenu->GetSafeHmenu();

是的,该错误是由ASSERT引起的。

Yes, the bug was caused by the ASSERT.

这篇关于CMFCMenuButton没有显示下拉列表在发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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