Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Microsoft C++ 6.0 instead of using old C Compiler... Pin
AlexO28-Jan-03 11:08
AlexO28-Jan-03 11:08 
GeneralRe: Using Microsoft C++ 6.0 instead of using old C Compiler... Pin
IrishSonic28-Jan-03 11:27
IrishSonic28-Jan-03 11:27 
GeneralRe: Using Microsoft C++ 6.0 instead of using old C Compiler... Pin
AlexO29-Jan-03 9:53
AlexO29-Jan-03 9:53 
QuestionGet point size from font? Pin
Moak28-Jan-03 9:02
Moak28-Jan-03 9:02 
AnswerRe: Get point size from font? Pin
valikac28-Jan-03 9:13
valikac28-Jan-03 9:13 
GeneralRe: Get point size from font? Pin
Moak28-Jan-03 9:26
Moak28-Jan-03 9:26 
GeneralRe: Get point size from font? Pin
valikac28-Jan-03 12:05
valikac28-Jan-03 12:05 
GeneralRe: Get point size from font? Pin
Moak28-Jan-03 20:12
Moak28-Jan-03 20:12 
QuestionHow to draw shadow for my thumbnail image? Pin
Hiusing28-Jan-03 8:06
Hiusing28-Jan-03 8:06 
AnswerRe: How to draw shadow for my thumbnail image? Pin
Chris Losinger28-Jan-03 8:37
professionalChris Losinger28-Jan-03 8:37 
AnswerRe: How to draw shadow for my thumbnail image? Pin
#realJSOP28-Jan-03 9:30
professional#realJSOP28-Jan-03 9:30 
GeneralXML Document Pin
Jamie Hale28-Jan-03 8:06
Jamie Hale28-Jan-03 8:06 
GeneralRe: XML Document Pin
Ryan_Roberts28-Jan-03 8:28
Ryan_Roberts28-Jan-03 8:28 
GeneralRe: XML Document Pin
Jamie Hale28-Jan-03 8:32
Jamie Hale28-Jan-03 8:32 
GeneralExtracting a number from text... Pin
Matt Gullett28-Jan-03 8:01
Matt Gullett28-Jan-03 8:01 
GeneralRe: Extracting a number from text... Pin
valikac28-Jan-03 9:16
valikac28-Jan-03 9:16 
GeneralRe: Extracting a number from text... Pin
Matt Gullett28-Jan-03 9:31
Matt Gullett28-Jan-03 9:31 
GeneralRe: Extracting a number from text... Pin
Anonymous28-Jan-03 10:21
Anonymous28-Jan-03 10:21 
GeneralRe: Extracting a number from text... Pin
Matt Gullett28-Jan-03 10:44
Matt Gullett28-Jan-03 10:44 
GeneralList View column formatting Pin
Brigg Thorp28-Jan-03 7:55
Brigg Thorp28-Jan-03 7:55 
GeneralRe: List View column formatting Pin
Roger Allen29-Jan-03 1:18
Roger Allen29-Jan-03 1:18 
GeneralTray Icon Pin
progman28-Jan-03 7:52
progman28-Jan-03 7:52 
GeneralRe: Tray Icon Pin
Abbas_Riazi28-Jan-03 18:13
professionalAbbas_Riazi28-Jan-03 18:13 
Generalsubsubmenu flyouts.... Pin
ns28-Jan-03 6:56
ns28-Jan-03 6:56 
GeneralUsing SetMenuInfo Pin
ns28-Jan-03 6:24
ns28-Jan-03 6:24 
MSDN says:

BOOL SetMenuInfo(
  HMENU hmenu,       // handle to menu
  LPCMENUINFO lpcmi  // menu information
);


Heres what I have done, and have #include winuser.h: My aim here is to press any one of the dynamic menu items that get created under the top level "mapdyn" and have it trigger the OnMenuCommand handler which sends in the index. I hope I have the correct menu handle etc (???), and am having trouble compiling:


 CMenu* mmenu =  ((CMainFrame*)AfxGetMainWnd())->GetMenu();

int pos = ((CMainFrame*)AfxGetMainWnd())->FindMenuItem(mmenu, "mapdyn");
if (pos == -1)
   return;

CMenu* submenu = mmenu->GetSubMenu(pos);

HMENU m_hMenu = submenu->GetSafeHmenu();

LPCMENUINFO  lpcmi;

lpcmi.dwStyle = MNS_NOTIFYBYPOS;

::SetMenuInfo(m_hMenu, lpcmi);


Compile error :

C:\BKView.cpp(176) : error C2065: 'LPCMENUINFO' : undeclared identifier


and the rest that follow....


Appreciate your help,
ns

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.