About without any body, i just checked it. I think you must provide default handling if you are not repainting the dialog itself(removing the CPaintDC dc(this) also) as CPaintDC constructor calls BeginPaint
I don't now details of BeginPaint and EndPaint what it seems either they should be handled once WM_PAINT is called or else default called which is CDialog::OnPaint().Code:CPaintDC::CPaintDC(CWnd* pWnd) { ASSERT_VALID(pWnd); ASSERT(::IsWindow(pWnd->m_hWnd)); if (!Attach(::BeginPaint(m_hWnd = pWnd->m_hWnd, &m_ps))) AfxThrowResourceException(); }
Hope this helps.
Note: you can do your painting on a dialog, that's what WM_PAINT is ment for.




Reply With Quote