PDA

View Full Version : Validate Rect causing Acess Violation



[hjd_uk]
12-23-2002, 05:34 AM
Im writing a OPenGL app in MFC. It is a SDI with an openGL context. All works fine in Debug mode sop far but i get the message

First-chance exception in OpenGL_MFC_.exe (GDI32.DLL): 0xC0000005: Access Violation.

when ValidateRect(NULL); is called in the OnPaint() Function. The message is ignored in debug mode and everything draws properly but the Release version doesnt allow it - obviously i need to resolve this, any ideas?

Thanks for any help.

[HJD_UK]

mikael_aronsson
12-23-2002, 06:30 AM
Hi !

I have no idea about the crash, but why call ValidateRect in the paint method, BeginPaint validates it for you so you don't need to do it.

Mikael