I'm trying to write a GDI wrapper using Win32:

So I maintain a DC in memory the whole time which is supposed to have my screen shot where I put all my graphics objects, then when its time to paint I always just bit transfer to the real DC. However this doesn't seem to be working, heres the problem



//This does not work:

FillRect(memHDC, Rect, BackBrush);
BitBlt (hdc, Rect.left, Rect.top, (Rect.right - Rect.left), (Rect.bottom - Rect.top), memHDC, 0, 0, SRCCOPY);


//However this does work:

FillRect(hdc, Rect, BackBrush);

//Also this works

SelectObject(memHDC, hBitmap);
BitBlt (hdc, x, y, width, height, memHDC, 0, 0, SRCCOPY);

Why is that?