override OnPaint() in CDialog


what's the correct override of CDialog::OnPaint()? Is it this:

void CMyDialog::OnPaint()
    CPaintDC dc(this);

     // now I can use dc to draw. But is the CDialog::OnPaint() call necessary?

Who is Participating?
jkrConnect With a Mentor Commented:
>>But is the CDialog::OnPaint() call necessary?

No, not really, since the implementation simply is

_AFXWIN_INLINE void CWnd::OnPaint()
    { Default(); }

'CDialog' inherits that 'empty' member from 'CWnd'. However, it does not hurt either.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.