Edit

Share via


D1194: Flush Outstanding DC

It is an invalid to call Flush or EndDraw in between a GetDC/ReleaseDC pair.

 

Possible Causes

While using a GDI interoperated rendertarget, an application may control the ownership of the target’s DC using IGdiInteropRenderTarget::GetDC or IGdiInteropRenderTarget::ReleaseDC. However, it is not valid to call ID2D1RenderTarget::Flush or ID2D1RenderTarget::EndDraw while the application has control of the DC. Flush and EndDraw may cause rendering to occur on the target resource, and Direct2D should not attempt to modify the resource at the same time as the application.

Possible Fixes

To address this message, ensure that the application does not call ID2D1RenderTarget::Flush or ID2D1RenderTarget::EndDraw while it has ownership of an IGdiInteropRenderTarget’s DC. If possible, organize the application to separate its Direct2D rendering behavior from its GDI behavior to make the distinction of DC ownership clearer.