Control to reload the wm_paint message.
In the overload of wm_paint, write: Do not call cedit: onpaint () for painting messages.
// Cpaintdc (this); // device context for painting
// Todo: add your message handler code here
// Do not call cedit: onpaint () for painting messages
Cedit: onpaint ();
If you follow the MFC advice, you must implement the paint by yourself, instead of calling the parent control.
If you do not do anything, you will find that the data cannot be updated. For example, in onpaint (), only cpaintdc (this );
If the function becomes an empty function (no statement ),ProgramEndless loop (unknown reason .)
In general, you must use the onpaint of the parent control to implement basic painting before adding your painting.Code.
Note: Do not use cpaintdc DC (this) for painting. This statement may invalidate the onpaint () of the parent control. (Unknown reason)
Instead, you should use getdc () to obtain the device pointer.