Why the view is flashing in Windows 2000

I am programming with MFC and OpenGL. I set the flags of PIXLFORMATDESCRIPTOR to PFD_DRAW_TO_WINDOW |PFD_DRAW_TO_BITMAP| PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER |PFD_STEREO_DONTCARE;

But the result is that when the mousing is moving around the menu items, the graphic in the view will flash(I think it’s repainting the graphic). I have tried to delete the PFD_DRAW_TO_BITMAP option, then the problem solved. But that’s not a good idea because I do need this PFD_DRAW_TO_BITMAP option. Can anyone help me and then tell me the real reason for this strange behaviour?
ps. this problem doesn’t appear in Windows NT.

Hi !

When you use PFD_DRAW_TO_BITMAP, how do you render the DIB section to the Window ?

One problem might be that you didn’t overloaded OnEraseBkgnd(), you must return… I think it’s TRUE to tell Windows to not erase the background first, this can cause flashing.

Mikael