We help IT Professionals succeed at work.
Get Started

GetMenu Error

artwilkes
artwilkes asked
on
1,206 Views
Last Modified: 2012-05-12
I am trying to use a copy of COXMenuBar::GetMenu, some code from day before yesterday in a program I'm trying to update.  When Compiling I get several errors.
This one is first, and here is the error

\oxmenubar.h(612): error C2555: 'COXMenuBar::GetMenu': overriding virtual function return type differs and is not covariant from 'CWnd::GetMenu'

the code where this occurs is, and is from ultimate toolbox available from the code project.

      // --- In  :      
      // --- Out :
      // --- Returns:      Handle to the menu that is used in the menu bar
      // --- Effect : Retrieves handle to the menubar menu
                    //changed from HMENU
      HMENU GetMenu() const {
            ASSERT(::IsWindow(GetSafeHwnd()));
            return m_hMenu;
      }

What change do I need to make and is this going to work or should I start over?
I'll send the entire file if you would like?
This seems to work in vc 2005
Thanks
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE