Visual Studio 6 (beginner)

  • Thread starter Thread starter Mihai Bozesan via .NET 247
  • Start date Start date
M

Mihai Bozesan via .NET 247

How can I use InsertMenuItem in Visual Studio 6???
error C2039: 'InsertMenuItemA' : is not a member of 'CMenu'
I have looked up in help and I have done everything they said there.
 
Mihai said:
How can I use InsertMenuItem in Visual Studio 6???
error C2039: 'InsertMenuItemA' : is not a member of 'CMenu'
I have looked up in help and I have done everything they said there.

The Win32 API has an InsertMenuItem macro, which (in your case) is
defined as

#define InsertMenuItem InsertMenuItemA

So every time you write InsertMenuItem anywhere in your source code, the
compiler systematically replaces that with InsertMenuItemA, without
thinking whether it's reasonable or not. That's why macros should be
'ALL_CAPITALS', not in 'TitleCase'.

Anyway, the workaround is:
#include <windows.h>
#undef InsertMenuItem

Tom
 

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

Back
Top