I placed a picture control and some edit and button controls for MFC in the non-modal dialog box, but I used the following function to refresh
Invalidate ();
Updatewindow ();
Cannot refresh
Later we found that:
Bool onerasebkgnd (CDC * PDC)
{
// Todo: add the message processing program code and/or call the default value here
Return false;
}
A problem occurs here. I directly return false to this function, and the background cannot be refreshed. However, after I change the function back,
Bool onerasebkgnd (CDC * PDC)
{
// Todo: add the message processing program code and/or call the default value here
Return cdialog: onerasebkgnd (PDC );
}
I can refresh the background, but I drew a rectangle on the picture control, which is flickering. I haven't solved it yet. I searched the internet and used double buffering. Then I went on to test it.
I didn't use double buffering later. I directly put the code for the rectangle
Pwnd-> invalidate ();
Pwnd-> updatewindow ();
The backend will not flash.