I am trying to keep my DCRenderTarget and on WM_PAINT, I am trying to reuse
it by just calling BindDC.
This works fine the first time, when I just created the render target.
Calling Sequence is:
if (!mTarget)
{
mFactory->CreateDCRenderTarget(...,mTarget);
}
mTarget->BindDC(dc,rect);
mTarget->BeginDraw();
....
// now comes stuff like loading bitmaps and drawing...
....
mTarget->EndDraw(); // D2D_RECREATE_TARGET is handled, too
the next time, WM_PAINT calls this sequence, BindDC fails with an Access
Violation:
First-chance exception at 0xfeeefeee in graphics.exe: 0xC0000005: Access
violation.
What am I missing? Is there something more I need to do to be able to reuse
a target?
Thanks
doc
> Hi,
>
> First-chance exception at 0xfeeefeee in graphics.exe: 0xC0000005: Access
> violation.
>
I think I know what the problem is: I ->Release()'d an object (a brush) that
was tied to the Target. I thought, by calling "Release()" it would also get
away from the Target, but obviously it is not.
Is there a way to remove an object like a brush or a bitmap from a
RenderTarget?
Or must I keep them all in it?
thanks
doc