Multi windows


I work with Windows 98 and I’ve some problems with multi-windows working.

The problem is following :

  • First the program is using a window with openGL capabilities and all the functions looks fine working.
  • I open a new window without any call to openGL function (so only API calls).
  • When I come back to the openGL window there is’nt any drawing.
  • In fact, the problem does’nt appear as recurrent but if it does’nt appears the first time,
    It’s appear after the next call.

If it can help someone, When I go out the second window
I’ve tried to explicitly set the currentDC as 0 ( with a wglMakeCurrent(NULL, NULL))
At the beginning of the PAINT’s message function with the OpenGL window
I check the value of the Current DC (wglGetCurrentDC) the answer is 0
but a call to the function wglMakeCurrent(DC, HRC) is without any effects, the values of DC and HRC are the sames values
as before the call to the second window, but a new call to wglGetCurrentDC is always with 0 as answer.
I can also say that the main goal of the second window is to prepare a printing page,
opening this view without any specific function calls is sufficiant to generate the problem.

I do’nt know understand what’s happend, can someone help me.


When you create another window what do you refer? Another instance of the same class or another class? I made a program that created at the run-time a window with OpenGl and when I created another instance of the same object appeared something that you describe. I assume that this is happening because I didn’t creare the RDC at the runtime (with new).


In fact, I work with 2 classes complitely differents.
I mean the 2 windows are inherited from the same basic class (as CView) but the first one is with full openGL functions to render to the screen and the second use only API function to show preview printing.