CreateCompatibleDC does not create a canvas on which you can draw. You have to create a bitmap and assign it to the context.
Try this:
m_hDC = BeginPaint(m_hWnd, &m_ps);
memDC = CreateCompatibleDC(m_hDC);
HBITMAP hBM = CreateCompatibleBitmap(m_hDC, 500, 200);
SelectObject(memDC, hBM);
// Now you can draw on memDC
// Fill with white color
RECT r;
SetRect(&r, 0, 0, 500, 200);
FillRect(memDC, &r, GetStockObject(WHITE_BRUSH));
// Draw text
::TextOut(memDC, 100, 100, "Hello world!", 12);
// Paint on window
BitBlt(m_hDC, 0, 0, 500, 200, memDC, 0, 0, SRCCOPY);
DeleteObject(hBM);
DeleteDC(memDC);
EndPaint(m_hWnd, &m_ps);