compiler error C2475 - 'member_name' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name

Posted on 2008-11-11
Last Modified: 2013-11-20
Hi Experts,

I'm using an MFC app and have the following code which won't compile because of the error in question.  What's going on here?

CMyDlg dlg;

	if(dlg.DoModal != IDOK)


Open in new window

Question by:thready
    LVL 86

    Accepted Solution

    Simple error, big effect - you forgot the brackets. Just use
    CMyDlg dlg;
            if(dlg.DoModal() != IDOK) // <---!

    Open in new window

    LVL 1

    Author Closing Comment

    I went to bed very late last night - proof that I should not ever be doing that.  I noticed it right after posting my question - but jkr, you are like one of the cowboys in the wild west - too fast for me to go back and delete my question - right after I posted it.... You already had the chance to read it and answer it......   Thanks - you deserve the points for being so fast!  ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
    Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
    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.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now