openGL with MDI

Dear friends,
i’ve got some problem to build openGL using
multiple document interface (MDI). I used vis c++ ver6.0 to build the MDI. My problem is when i’ll created a new child frame, the other or the older child frame that already built will be blank a way, all object that i’ve already built were gone, just a white space that shown on the screen.
Well i think, may be i forgot to handle it, but by the way how to handle the openGl object on the child frame ??

I’m not sure this is the problem. But Before begin to make Rendering operation you must
make a call to
wglMakeCurrent( DeviceContextHandle, RenderingCOntextHandle) to make current the rendering context.
I use 2 data members to store this 2 vars.
Another thing:
Override the function OnEraseBkG so that
the only line of code inside this function would be:
return TRUE.

I hope this can be helpful to you
Bye
Fabio

thank’s fabio
but how to do that ? i mean , if i can found that wglmake… on the class wizard or something else ?
Cause when i rendering the object, i just use hdc nothing else on wm_paint

thank’s

thank’s fabio
but how to do that ? i mean , if i can found that wglmake… on the class wizard or something else ?
Cause when i rendering the object, i just use hdc nothing else on wm_paint

thank’s

Ok, I think you should do this:

Use 2 data member in your class derived from CView:
HDC m_hDC;
HGLRC m_hRC;

I think you use an initialize procedure to set up all opengl informations, the pixel format and the rendering context, ecc.
Replace the local variable HDC and HGLRC with the data member (m_hDC and m_hRC) whenever you find them.

Use the wizard function OnDraw to paint the window (not onPaint), and insert:

wglMakeCurrent( m_hDC, m_hRC);
…openGL drawing code.

It should work.

Bye
Fabio