I created a MFC ActiveX Control, and within it I created a child dialog that will be used in the .NET environment. Within the dialog, I have a button and I put a tooltip when you hover your mouse, it should display the tooltip. For some reason, when I am using the dialog in the .NET environment, it won't work.
I created an MFC Dialog Application and performed the same thing and it works fine, but not through ActiveX when it is put in the C# .NET environment.
This is my code:
MainDialog.h
CToolTipCtrl m_tooltip;
MainDialog.cpp
CButton *PlayButton = (CButton*)GetDlgItem(IDC_PLAY_BUTTON);
m_tooltip.Create(this);
m_tooltip.AddTool(PlayButton, L"Play");
m_tooltip.Activate(TRUE);
BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
MSG msg;
msg.wParam = wParam;
msg.lParam = lParam;
msg.message = message;
msg.hwnd = m_hWnd;
GetCursorPos(&msg.pt);
// Tooltips notification.
FilterToolTipMessage(&msg);
return CWnd::OnWndMsg(message, wParam, lParam, pResult);
}
I first used PreTranslateMessage
but I read on http://forum.codejock.com/forum_posts.asp?TID=1361&title=task-panel-tooltips-in-activex-control
here that it doesn't work with MFC but this code displayed above does but it doesn't work for me.
Any help is appreciated!