CMFCButton ToolTip无法按计划运行 [英] CMFCButton ToolTip not working as planned

查看:70
本文介绍了CMFCButton ToolTip无法按计划运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在尝试将工具提示添加到对话框中:



我的代码,这是在OnInitDialog



Hello,
Im trying to add tooltips to a dialog:

My code,which is in OnInitDialog

m_FinishBitmap.LoadBitmap(IDB_ICON_FINISH1);
   CMFCButton *pFinish = (CMFCButton *)GetDlgItem(IDC_BUTTON_MEASURE_FINISH);
   pFinish->SetBitmap(m_FinishBitmap);
   pFinish->SetTooltip(_T("Finish Feature"));







错误信息:



_AFXWIN_INLINE HWND CWnd :: GetSafeHwnd()const

{return this == NULL? NULL:m_hWnd; } $ / $


问题是该软件与此调试消息挂起,因为在您开始使用该软件之前,该对话框不会被初始化。



如果我注释掉SetToolTip行,一切都很好。



请帮助我真的卡住



谢谢

Derrek




error message:

_AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const
{ return this == NULL ? NULL : m_hWnd; }

The problem is that the software hangs with this debug message because the dialog doesnt get initialized until you start using the software.

If I comment out the SetToolTip line everything is fine.

Please help Im really stuck

Thanks
Derrek

推荐答案

这只是一个猜测但你可能在你提供的代码之前没有调用__super :: OnInitDialog()或UpdateData()。



此处出现的4行应在此之后调用,而不是之前调用。
This is just a guess but you probably aren''t calling __super::OnInitDialog() or UpdateData() before the code you provided.

The 4 lines you present here should be called after doing that, not before.


这篇关于CMFCButton ToolTip无法按计划运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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