The information in this article applies to:
SYMPTOMSFocus notifications (EN_SETFOCUS, BN_SETFOCUS, and so on) for controls in a CFormView are usually handled in the CFormView class. Calling a function that relies on the window handle of the control (m_hWnd) inside such a handler may cause an assertion failure in Afxwin2.inl. This happens only if the control is the first one in the tab order. CAUSEThe assertion failure occurs because the focus handler for the control is being called before OnInitialUpdate() is called for the CFormView. RESOLUTIONTo work around this problem, make sure that the m_hWnd member of the control is not NULL before calling any function that relies on it. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1. Sample CodeThe following illustrates calling SetSel in the for an Edit control.
Additional query words: kbVC400bug 4.00 4.10
Keywords : kbMFC KbUIDesign kbVC kbVC410fix |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |