i have created an mfc activex control and want to handle the keystrokes. to handle keystrokes in child dialog. i override the pretranslate message in my child dialog class.to use pretranslate funtion in an activex control i have added hook . as solution for the similar problem described at http://support.microsoft.com/kb/194294. Now pretranslate function is calling but the problem when i press the ESC key or enter key , an assertion come at ASSERT(::IsWindow(m_hWnd));at wincore.cpp line 880.
A:
I guess you use a function in PreTranslateMessage that assumes that the window is created. Put
if (!::IsWindow(m_hWnd)) { return 0; }
in the beginning of your PreTranslateMessage and see if that helps.
Roel
2010-03-10 18:35:01