Problem with overdraw in Windows MDI app

I have a little problem in that occasionally when I redraw a MDI window with a OpenGL Rendering context it will sometimes draw on top of other OpenGL windows, or the app frame window when it is supposed to be behind and therefore clipped by these items.

Any ideas?

Thanks