FIX: CWnd::SubclassDlgItem Returns FALSE for OLE Controls (148703)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
This article was previously published under Q148703 SYMPTOMS
Using CWnd::SubclassDlgItem to subclass an OLE Control returns FALSE,
after failing on the check for m_pCtrlCont != NULL in line 301 of
Winctrl1.cpp.
CAUSE
The MFC framework's implementation of CWnd::SubclassDlgItem checks and
uses the CWnd::m_pCtrlCont member of the OLE control, instead of the
control container, which is the parent of the control. The source code
should use pParent->m_pCtrlCont in order to access the container.
RESOLUTION
As a workaround, use CWnd::SubclassWindow instead of CWnd::SubclassDlgItem,
which is illustrated in the sample code section in this article.
STATUS
Microsoft has confirmed this to be bug in the Microsoft products listed at
the beginning of this article. This problem was corrected in Microsoft
Visual C++, 32-bit Edition, version 4.1.
Modification Type: | Major | Last Reviewed: | 10/24/2003 |
---|
Keywords: | kbBug kbCtrl kbfix kbNoUpdate kbVC410fix KB148703 |
---|
|