OpenGL Error in Debug Mode (VC++ 7, XP)

Hi,
i’ve written an application with “OpenGL-views” in VC++ 6. Everything
is ok. If i try to run that program in the debug mode of VC++ 7, an
error message occurs: handle not valid ( at the function:
wglDeleteContext). There are no problems in the release mode. This
error occurs also in the OpenGL examples of www.codeguru.com and www.codeproject.com and the MSDN CUBE-example.
Where is the problem ?
Thanks

Hi !

Check your code, you get this type of errors in debug mode, in release mode it’s ignored, that’s why you think it works, it doesn’t, you just don’t get any error messages.

Check that you don’t try to delete it two times or something like that.

Mikael

Hi Mikael,
thanks for your answer. I agree, it is possible, that this type of error is ingored in release mode. But this error message doesn’t occur in VC++ 6 (Win98) in the debug mode. If i try to delete it two times, it has to occur there too. Do you agree ?

Hi !

Yes, try to set the handle to NULL when you have deleted it (does not help, but it’s a good way to find errors), check the handle so that it isn’t NULL before you try to delete it to see if that’s the problem, I guess it’s not as you are using it in your code, sorry I have no better idea.

Mikael