Should I override "DoModal" to force my dialog to quit if the Init fails?
Posted on 2004-09-23
I have this problem... My dialog (CDialog) checks a few system variables and settings before displaying anything... So in my InitDialog, I do all the checks and then set a flag called "m_InitSuccess" to TRUE...
Then I want to override DoModal to check the flag and then return IDABORT when that flag is FALSE....
I have two questions about this, first, is this the only (or best) way to cancel out of a dialog? and second, should I just move all my checking code into my DoModal?
Also, what do you think about calling EndDialog(IDABORT) from within the OnInitDialog handler?