override OnPaint() in CDialog

Posted on 2007-07-26
Last Modified: 2013-11-20

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?

Question by:DJ_AM_Juicebox
    1 Comment
    LVL 86

    Accepted Solution

    >>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.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now