Duffers question (revision in MFC)

K

kizmet

Ok - so I'm going through my teach yourself VC++ in 21 days book
second time around for revision). I've got to day 2 (groan).

The book says to put the following code in....

void CDay2Dlg::OnExit()
{
// TODO: Add your control notification handler code here
OnOK();
}

But I can only get the function to work if I write it as:

void CDay2Dlg::OnExit()
{
// TODO: Add your control notification handler code here
CDay2Dlg::OnOK();
}

Last time I did this it worked fine without the CDay2Dlg::

Any ideas? Thanks...
 
V

Victor Bazarov

kizmet said:
Ok - so I'm going through my teach yourself VC++ in 21 days book
second time around for revision). I've got to day 2 (groan).

The book says to put the following code in....

void CDay2Dlg::OnExit()
{
// TODO: Add your control notification handler code here
OnOK();
}

But I can only get the function to work if I write it as:

void CDay2Dlg::OnExit()
{
// TODO: Add your control notification handler code here
CDay2Dlg::OnOK();
}

Last time I did this it worked fine without the CDay2Dlg::

Any ideas? Thanks...

Since MFC is not topical here, you have two choices: post to an MFC
newsgroup (like microsoft.public.vc.mfc) or follow the suggestions
outlined in FAQ 5.8. If you decide to do the latter, keep in mind
that none of MFC classes are known here, so you'll need to emulate
what's involved with Standard C++ constructs.

Also, it is extremely useful to indicate what makes you think that
you can't get the code to work in the initial form. Do you get some
kind of compiler diagnostic? If so, do we have to guess or will you
be kind enough to tell us next time?

Now, this is a shot in the dark, but often the necessity to fully
qualify the name stems from the inability of the compiler to find
the name or to resolve it into a single name when more than one is
available. It happens in templates, it happens with multiple
inheritance, but in your case I have no idea as to the real reason
since CDay2Dlg is undefined.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,652
Latest member
Campbellamy

Latest Threads

Top