Article ID: 113421 - Last Review: November 21, 2006 - Revision: 3.1 PRB: Assertion Failed, WINCORE.CPP--Line 129, 133, 182, or 307This article was previously published under Q113421 SYMPTOMS
Opening a dialog box in an application that subclasses a control of the
dialog box using CWnd::SubclassDlgItem() or CWnd::SubclassWindow() causes
an "Assertion Failed!" error in WINCORE.CPP. The line number reported
depends on the version of the Microsoft Foundation Classes (MFC) being
used:
Version 2.0 for Windows - Line 133
Version 2.5 for Windows - Line 182
Version 2.0 32-bit Edition - Line 129
Version 3.0 32-bit Edition - Line 283
Version 3.1 32-bit Edition - Line 315
Version 4.0 32-bit Edition - Line 307
CAUSE
The second ASSERT (below) in WINCORE.CPP is the one being hit:
With MFC dialog boxes, you can specify DDX/DDV member variables to associate with the controls of an MFC dialog class. These member variables can be real values (for example, int, CString) or control variables (for example, CEdit, CListBox). If the member variables are control variables, then the DDX/DDV handlers actually do subclass the dialog box controls using the control member variables. If you try to subclass those controls yourself, the above error can result. RESOLUTION
If you want to subclass controls yourself, then do not associate DDX/DDV
variables with those controls. Alternatively, if you want to subclass controls but avoid the work, you can let the DDX/DDV routines work for you. To do this, use the following steps.
APPLIES TO
| Article Translations
|


Back to the top
