Click here to Skip to main content
15,745,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote in OnInitDialog:

CToolTipCtrl m_tip;
	m_tip.AddTool(GetDlgItem(IDC_BUTTON9), _T("Tooltip text"));

but tooltip doesn't appear..

What I have tried:

I tried to use a pointer fot tip but it's the same thing
Updated 3-Feb-20 0:20am

You need some steps more to do like, handling the tooltip messages.

Read the CListCtrl and Displaying a Tooltip article and code for the details.
Share this answer
Member 14594285 3-Feb-20 8:27am    
so I must do a subclass?? it's so longer
Member 14594285 3-Feb-20 10:42am    
I solved, I used pretranslate message, but If I want to show tip inside button?
I suspect it may be because m_tip is a local variable, and goes out of scope at the end of OnInitDialog. Try adding the variable to the CDialog class so it remains for the life of the dialog.
Share this answer
Member 14594285 3-Feb-20 8:27am    
it isn't that
Richard MacCutchan 3-Feb-20 8:46am    
Well I was largely guessing as I do not have MFC, and it is quite a few years since I used it.
Member 14594285 3-Feb-20 10:41am    
I solved..I wrote:

BOOL CMFCApplication22Dlg::PreTranslateMessage(MSG* pMsg)
return CDialog::PreTranslateMessage(pMsg);

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

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