OnPaint() 함수안에 작성
CDC memDC;
CBitmap bitmap, *pOldBitmap;
CRect rt;
GetClientRect(&rt);
memDC.CreateCompatibleDC(&dc);
bitmap.CreateCompatibleBitmap(&dc, rt.Width(), rt.Height());
pOldBitmap = memDC.SelectObject(&bitmap);
작업함수(&memDC);
dc.BitBlt(rt.left, rt.top, rt.Width(), rt.Height(), &memDC, 0, 0, SRCCOPY);
DeleteObject(memDC.SelectObject(pOldBitmap));
memDC.DeleteDC();
윈도우 api 정말 오랫만에 보네요