Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PretranslateMessage Not Getting Called

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
Why doesn't PreTranslateMessage(MSG* pMsg) get called from an ActiveX control when the ActiveX control is displayed in the webpage (IE)? I'm using PreTranslateMessage to display tooltips via:

BOOL CPsaSelectorCtrl::preTranslateMessage(MSG* pMsg)
{
//if the toop tip is valid
if(m_pToolTip)
m_pToolTip->RelayEvent(pMsg);
return COleControl::preTranslateMessage(pMsg);
}

Anyway, when I display the ActiveX control in the 'ActiveX Control Test Container' utility program PreTranslateMessage gets called and everything works. When I placed the ActiveX control on a webpage it DOESN'T get called and no tooltips are displayed! How could I fix this?

Thanks,
bitwise
 
Please read the articles:
- "PRB: MFC ActiveX Control in IE Doesn't Detect Keystrokes"
- "PRB: TranslateAccelerator() Not Called for ActiveX Controls"

from MSDN in order to get a grip of the problem.(I have MSDN Jan 2001).

Good luck, s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
 
Thanks for the articles they helped me understand the problem more. The only problem is: can it be fixed? I have one CListCtrl that is a child control of the Activex control. I have tried calling OnActivateInPlace(TRUE, NULL); from numerous places, but PreTranslateMessage still does not get called. Is there something I'm not picking up from the articles?

Thanks,
bitwise
 
Ha! Screw you Windows. In order to call PreTranslateMessage from an ActiveX control you have to set up a CALLBACK hook procedure that captures the WH_GETMESSAGE message that allows you to gain access to the MSG and pass it on over to PreTranslateMessage()! That really sucked figuring that out but it works.

bitwise

If anyone has ever had this problem with PreTranslateMessage never getting called from IE let me know I'll ship over the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top