Dave's Brain

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();

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.