• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

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

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

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

Open in new window

threadyAuthor Commented:
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!  ;-)
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now