MFC dialog-based applications, in the main dialog statement with the SetTimer a timer, drawing in the timer response function, in the main dialog to add a button, click on the button, pop up a modal dialog box, the modal dialog on the drop-down list control, Above the basic function for the program, the program compiled through, began to run, all OK., click on the button, popup a modal dialog box, is everything OK at this time, drag a modal dialog box or click on the drop-down list control, the main dialog box drawing work stopped in the timer, time grows, the program card dead are directly, To solve this problem, I remove the timer, open a thread in the main program for drawing, successfully solve the problem, In practical application, however, have to use a timer (SetTimer) for drawing, so only in a modal dialog box to find a way to, was not recruit, BBS Daniel guidance, genuflect is begged
CodePudding user response:
I also encountered this problem before, Back to find the solution: when will need to bring up a dialog box to turn off the timer KillTimer, then in child dialogs initialization function, then obtain the main dialog pointer, and open the timer,
CodePudding user response:
The timer messages lowest priority!
CodePudding user response:
Drawing operations should write in the OnPaint function all Timer just modify the parameter called Invalid redrawn to activate