override OnPaint() in CDialog

Hi,

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

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

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

Thanks
DJ_AM_JuiceboxAsked:
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.
0
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.