I call getDC(hwnd) and then later on close call ReleaseDC(hwnd,dc). This is for an OpenGL engine and after i call WGLMakeCurrent(Null,Null) and WGLDeleteContext.
ReleaseDC returns error code 1425 which is 1425L ERROR_DC_NOT_FOUND Invalid HDC passed to ReleaseDC.
I don't understand how an HDC could be invalid after previously getting it from the same HWND.
I checked its pointer when i got it and it remains the same (not that it helps to check such a thing), but I am running out of ideas.