The information in this article applies to:
SYMPTOMS
It is possible to use AppWizard to create an OLE Custom Control (.ocx file)
that subclasses a standard Windows control. If you choose to subclass an
edit control, the control will not exhibit the same behavior as a standard
edit control. CAUSECOleControl handles the WM_SETTEXT message in its OnSetText handler. The first few lines of this function are:
When a user types text into the control, the m_strText member is not
updated. Therefore, when SetWindowText(NULL) is called on the control, the
first expression is evaluated as TRUE, even though the edit control is not
truly empty. This expression is interpreted as property not changed, and
the function exits.
RESOLUTION
To work around this problem, override OnSetText() in the COleControl
derived class, and copy the code from COleControl::OnSetText() into the
overridden funtion, with the following change:
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ 32-bit Edition, version 4.2. Additional query words: kbVC400bug 4.00 4.10 vcfixlist420
Keywords : kbole kbMFC kbVC |
Last Reviewed: September 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |