GDI Access Violation using OpenGL in DLL

I’ve been trying to write an 3d modeler for Win32 using an MFC-based main program and non-MFC based DLLs. The basic idea is the main program creates the window and the opengl rendering context and then calls functions in the DLL that execute gl commands to draw to the window… It usually works, but in debugging it I noted that every time the code executes gl commands in the DLLs i get an access violation in GDI.DLL. Commenting out the calls to the DLL, any gl commands within the main program paint call execute just fine. Any ideas?

VC Debug output:
“First-chance exception in main.exe (GDI32.DLL): 0xC0000005: Access Violation.”

Those are <shudder> normal. Don’t worry about those, they won’t cause any harm to your app. I’ve seen them even when debugging Q3A game code.

In windows, GDI and double buffered opengl stuff don’t like each other. Try not to do any gdi operations on that window.

Yeah, GDI and OpenGL = problems
However, I had this phenomen also
in code which did NOT use GDI.
And it didn’t even happen always.

I am sorry, but I possted an identical topic on 06.26, missing this one.

I am very concerned about the following matter:
Do those GDI32 access violations
realy do no harm?
That is, for a 100 cases
everyting may be OK, and for 101 case, when you are just presenting your application to the customer, they acctualy DO some harm (Murphie’s lows are not just a funny jokes!).

Could anyone of you ask, or tell me how to ask Microsoft directly about those GDI32 exceptions when rendering to a window (doesn’t matter double or single, mixing GDI calls or not)?