Browse - Programming Tips - Why is my MFC program asserting at line 246 of winocc.cpp ?

Date: 2010jan18
Language: C/C++
Framework: MFC
OS: Windows

Q.  Why is my MFC program asserting at line 246 of winocc.cpp ?

A.  You probably forgot to call:

CDialog::OnInitDialog();
at the start of your class's OnInitDialog() method. It should look like this:
BOOL CMyDlg::OnInitDialog() { CDialog::OnInitDialog(); // ... Do your stuff ... return TRUE; }
Declared in the .h file as:
virtual BOOL OnInitDialog();