Home > Software engineering >  MFC in the view class USES timers to realize dynamic drawing
MFC in the view class USES timers to realize dynamic drawing

Time:09-23

I am of the view class ontouch () function is used in the SetTimer () function defines a timer, and then used in the destructor KillTimer () function to close the timer, compile the connection is correct, can run, can also open the. Exe file, but an error occurred when closed,

CodePudding user response:

Start the timer in the OnInitialUpdate, destruction of the timer in the DestroyWindow

CodePudding user response:

And then used in the destructor KillTimer () function to close the timer, this place didn't release

CodePudding user response:

KillTimer put it in the OnClose message processing function, because the timer related to create and the window object, the first parameter is the settimer, destructor, window object has been destroyed, the first step to close the window is to close the window first, and then destruction of other resources, so try to destroy the timer before destruction of window
  • Related