Creating dynamic menu items
Im learning to make dynamic menues for an application I'm writing, btu this code from petzold doesnt create the proper result. Perhaps I'm missing something.
Code:
hMenu = CreateMenu();
hMenuPopup = CreateMenu();
pOption = (UINT_PTR)&Option;
Option = 40001;
AppendMenu(hMenuPopup , MF_STRING , 40001 , "E&xit");
Option = (UINT)hMenuPopup;
AppendMenu(hMenu , MF_POPUP , pOption , "&File");
SetMenu(hwnd , hMenu);
all it creates is the File menu, but with no popup item in it.