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
 
Back
Top