troubleshooting Question

MFC: Overloading a CDialog derived class's OnOk()

Avatar of sternocera
sternocera asked on
System ProgrammingMicrosoft DevelopmentEditors IDEs
19 Comments2 Solutions1162 ViewsLast Modified:
I seem to be having difficulty overloading my dialog's OnOk(). Here's what I've done:

      void OnOk();

void CAuthenticate::OnOk()
AfxMessageBox("ok pressed");


Confusingly, this works fine:

      void OnCancel();

void CAuthenticate::OnCancel()
      AfxMessageBox("Cancel pressed");      


What have I done wrong?

Thanks in advance,
IT Professional
Join our community to see this answer!
Unlock 2 Answers and 19 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 19 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros