Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem with Menu and Submenu / Entries

Problem with Menu and Submenu / Entries

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    P Rex
    wrote on last edited by
    #1

    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 1 Reply Last reply
    0
    • P 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 Offline
      I Offline
      Iain Clarke Warrior Programmer
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups