Asked By docschnipp
02-Nov-09 05:53 PM
Hi,
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