PreTranslateMessage and m_msgCur problem



I have noticed an odd problem in our DLL module. One of my CWnd-based
classes overwrites PreTranslateMessage and checks for WM_KEYDOWN with
VK_TAB. When this message comes, the code does some processing and shows a
modal dialog box or property ***. After the user closes the popup window,
my PreTranslateMessage continues executing and it calls CWnd's
PreTranslateMessage with the supplied pMsg. The problem is that the message
passed to CWnd::PreTranslateMessage is not the same as the message that came
in indicating that the module state's m_msgCur was changed during showing
the popup window. This will cause asserts in MFC code. What am I doing wrong
or is this an expected behavior in some cases? What can I do to avoid this
problem?

Thanks in advance.

--
Timo Partanen
www.m-files.com


.