• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 461
  • 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?

Thanks,
Mike
CMyDlg dlg;
	if(dlg.DoModal != IDOK)
		return;

Open in new window

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

Open in new window

0
 
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!  ;-)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

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