Click here to Skip to main content
15,911,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
Im trying to add tooltips to a dialog:

My code,which is in OnInitDialog

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



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
Posted

1 solution

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.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900