Problem with Menu and Submenu / Entries
-
Hi Guys, In my Application i have some Menus. The Menus work fine with W2k and Win XP. The Menus look like those from MS Word (File -> New, File -> Open, File -> Save, File -> Save as etc.). On Windwows NT 4 they are displayed a bit strange. File -> ,÷| (should be File -> New) File -> ,÷| (should be File -> Open) and so on. I have this problem for the whole menus on Win NT 4 :(( Can anybody help me to solve this problem? P-Rex
-
Hi Guys, In my Application i have some Menus. The Menus work fine with W2k and Win XP. The Menus look like those from MS Word (File -> New, File -> Open, File -> Save, File -> Save as etc.). On Windwows NT 4 they are displayed a bit strange. File -> ,÷| (should be File -> New) File -> ,÷| (should be File -> Open) and so on. I have this problem for the whole menus on Win NT 4 :(( Can anybody help me to solve this problem? P-Rex
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.