I should point out that I'm releasing all unused DCs, so I don't think memory leaks are the problem. Here's the code (from the draw method).

Code:
SelectObject (hdcMem, hbmpOld);
SelectObject (hdcMem, brushOld);
DeleteObject (brush);
DeleteDC (hdcMem);