Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Task Panel Tooltips in ActiveX control
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Task Panel Tooltips in ActiveX control

 Post Reply Post Reply
Author
Message
KFournier View Drop Down
Groupie
Groupie
Avatar

Joined: 17 August 2004
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote KFournier Quote  Post ReplyReply Direct Link To This Post Topic: Task Panel Tooltips in ActiveX control
    Posted: 02 November 2004 at 3:46pm

I'm writing an MFC ActiveX control in VC++ 6.0 which has a child task panel control. Tooltips do not appear for this control, and I was able to trace it down to the fact that (1) PreTranslateMessage doesn't fire for MFC ActiveX controls (at least is the application in which my controls are embedded) and (2) even if I get it to fire, AFX_MODULE_STATE's m_pfnFilterToolTipMessage is NULL.

I also noticed the _XTP_ACTIVEX section of the CXTPTaskPanel::Create method for setting the AFX_MODULE_STATE's pfnFilterToolTipMessage to AxFilterToolTipMessage. Now, as far as I can tell, AxFilterToolTipMessage is not MFC.

So, the question is: what's the best way to get this control's tooltips to appear? Should I try to force PreTranslateMessage to fire, or just call CWnd::FilterToolTipMessage directly somewhere?

Kevin R. Fournier
SRP Computer Solutions, Inc.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2004 at 3:41am

All right. PreTranslateMessage doesn't work with ActiveX. (MFC feature)

you need:

Override CXTPTaskPanel and add

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);
 } 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
KFournier View Drop Down
Groupie
Groupie
Avatar

Joined: 17 August 2004
Location: United States
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote KFournier Quote  Post ReplyReply Direct Link To This Post Posted: 03 November 2004 at 10:51am
Worked like a charm. Thank you.
Kevin R. Fournier
SRP Computer Solutions, Inc.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.