I had exactly the same problem a few years ago. I investigated, and found that MENUITEMINFO had expanded post NT4. Fortunately, I didn't need any of the new fields, so I just used my own retro class. Newer OSs can cope with the older structure, but not vice versa. You can get similar effects by playing with platform definitions, but this seemed less intrusive. It is also better than MENUITEMINFO, as it self initialises with sensible starting values.
struct CMenuItemInfo
{
UINT cbSize;
UINT fMask;
UINT fType; // used if MIIM_TYPE (4.0) or MIIM_FTYPE (>4.0)
UINT fState; // used if MIIM_STATE
UINT wID; // used if MIIM_ID
HMENU hSubMenu; // used if MIIM_SUBMENU
HBITMAP hbmpChecked; // used if MIIM_CHECKMARKS
HBITMAP hbmpUnchecked; // used if MIIM_CHECKMARKS
DWORD dwItemData; // used if MIIM_DATA
LPTSTR dwTypeData; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
UINT cch; // used if MIIM_TYPE (4.0) or MIIM_STRING (>4.0)
CMenuItemInfo()
{
memset(this, 0, sizeof(CMenuItemInfo));
cbSize = sizeof(CMenuItemInfo);
};
inline operator LPMENUITEMINFO() const
{
return (LPMENUITEMINFO)this;
}
};
I hope this helps. Iain.