Random silent GDI32 exceptions with OpenGL related functions

On Win 9x platforms I get a lot of GDI32 exceptions generated by wglMakeCurrent(), or/and wglCreateContext() or/and ChoosePixelFormat() or/and SetPixelFormat().
This exceptions come randomly in a batch of
about 20 exceptions at one time. They are
visible in Debug only and seem not to do any harm in Release. I didn’t pay much attention to them until I found one PentiumII machine
on which my OpenGL application randomly crashes inside a kernel32 or GDI32 code and
I suspect that there might be a connection.
(i made sure that this machine uses the same libraries).
Please drop a line, if some of you also experienced similar problems (even if you don’t know the ansewer to them).

could you paste some code?

(short answer,huh? :slight_smile: )

Personaly i really don’t care about these
wgl exceptions… Anyway, for better code
quality you should use the glut library
in your code which provides fullscreen modes
and other cool stuff… Moreover your code
will be compatible with other operating systems…

I’d have to take issue with the statement that using GLUT improves quality. While it does in general make it easier to write non-platform specific code, that doesn’t necessarily make the code run better. It is what goes inbetween the calls to GLUT functions that really matters performance wise. Oh, and fullscreen modes are available even when not using GLUT (GLUT just makes it easier to use them if it can).

I forgot to add a very important detail.
My application is MDI and I render to very
different things including DIB section and
DirectDraw surface (when in the full screen mode of my application). But the exceptions
come only when rendering to a CView window
(doesn’t matter if double or single buffered).
As far as the code is concerned it is a basic sequence of setting a pixelformat, creating RC and making it current. I tried two approaches, one with RC created after each WM_PAINT, and the second with RC created once for a windows’ lifetime. The exceptions rice in both cases.
As far as GLUT is concerned, it is of cource great, but I am affraid that my application is just to much MS Windows specific.