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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetTimer with modeless Dialog Box

Status
Not open for further replies.

BobbyB

Programmer
Feb 19, 2002
44
CA
While a process is running on one hand I'd like to open a dialog box that'll display something that is moving to show the user that the program haven't crash... The timer works fine if I initialize my dialog as modal but when I open it as modeless, SetTimer returns TRUE since it works, but never calls the OnTimer method... Someone got an idea? Thanks.

main(){
myDlg dlg;
dlg.create(myDlg::IDD);
//big process that takes time
dlg.destroy();
}

class myDlg : public CDialog {
...

BOOL myDlg::OnInitDialog(){
CDialog::OnInitDialog();
SetTimer(1, 1000, NULL); // SetTimer returns TRUE...

return TRUE;
}

void myDlg::OnTimer(UINT nIDEvent){
if (nIDEvent == 1){
MessageBox("it works");
}

CDialog::OnTimer(nIDEvent);
}
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top