Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I auto-validate a dialog after it displays?

Status
Not open for further replies.

davidewan

Programmer
Aug 4, 2000
16
CA
Hi all,

I've got a dialog. when it displays, I want to check the info loaded and warn the user if some of the data is bad (e.g. invalid directory). Doing this check while the dialog is constructing results in the error message popping up first, then the dialog (after the uer acknowledges the error) which is kind of dumb. What I really want is the dialog to appear and then the error messages. One solution I've thought of is to send a home grown message to myself :):postMessage()) during OnInitDialog(). I'm just wondering if there's a neater way? Thanks in advance. David. [sig][/sig]
 
in OnInitDialog:

SetTimer( 1 , 100 , NULL );

Add WM_TIMER and then:

void CYourDlg::OnTimer(UINT nIDEvent)
{
if ( nIDEvent == 1 )
{
KillTimer( 1 );
AfxMessageBox( ........... );
}

CDialog::OnTimer(nIDEvent);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top