Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating the flyout menu of a submenu Pin
ns23-Jan-03 5:38
ns23-Jan-03 5:38 
GeneralRe: Creating the flyout menu of a submenu Pin
Moak25-Aug-10 23:54
Moak25-Aug-10 23:54 
Generaldebugging the release version Pin
ns22-Jan-03 9:42
ns22-Jan-03 9:42 
GeneralRe: debugging the release version Pin
Chris Losinger22-Jan-03 10:09
professionalChris Losinger22-Jan-03 10:09 
GeneralRe: debugging the release version Pin
ns22-Jan-03 10:17
ns22-Jan-03 10:17 
GeneralFonts not changing when printing, but not on every machine.. Pin
dazinith22-Jan-03 9:19
dazinith22-Jan-03 9:19 
GeneralRe: Fonts not changing when printing, but not on every machine.. Pin
Roger Allen23-Jan-03 2:44
Roger Allen23-Jan-03 2:44 
QuestionHow to modify this CMenu snippet? Pin
ns22-Jan-03 8:49
ns22-Jan-03 8:49 
From MSDN:

   // Get the menu from the application window.
   CMenu* mmenu = GetMenu();

   // Look for "File" menu.
   int pos = FindMenuItem(mmenu, "&File");
   if (pos == -1)
      return;
   Here I want to append a submenu under "File". THere are no existing submenu items...


<code>   CMenu* submenu = mmenu->GetSubMenu(pos);
   pos = FindMenuItem(submenu, "&New\tCtrl+N");
   if (pos > -1)
      submenu->RemoveMenu(pos, MF_BYPOSITION);</code>


THe code in red is not what I want to do . I want to add stuff under "File" presuming it starts with nothing under it. Or do I resort to the cheap trick of putting in a submenu item with Resource editor, and then doing a removemenu on it? ANd then appendmenu my stuff?

Basically code> CMenu* submenu = mmenu->GetSubMenu(pos); - will this give me a pointer even if I dont have a submenu at all yet?

Appreciate your help,
ns
AnswerRe: How to modify this CMenu snippet? Pin
Joaquín M López Muñoz22-Jan-03 9:06
Joaquín M López Muñoz22-Jan-03 9:06 
GeneralRe: How to modify this CMenu snippet? Pin
ns22-Jan-03 9:18
ns22-Jan-03 9:18 
GeneralRe: How to modify this CMenu snippet? Pin
Joaquín M López Muñoz22-Jan-03 9:38
Joaquín M López Muñoz22-Jan-03 9:38 
GeneralRe: How to modify this CMenu snippet? Pin
ns22-Jan-03 9:47
ns22-Jan-03 9:47 
GeneralRe: How to modify this CMenu snippet? Pin
Joaquín M López Muñoz22-Jan-03 9:48
Joaquín M López Muñoz22-Jan-03 9:48 
GeneralA million zillion thanks!!!! Pin
ns23-Jan-03 4:09
ns23-Jan-03 4:09 
Generaldetect new cdrom Pin
particle2k22-Jan-03 8:39
particle2k22-Jan-03 8:39 
GeneralRe: detect new cdrom Pin
dazinith22-Jan-03 9:12
dazinith22-Jan-03 9:12 
GeneralMFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joan M22-Jan-03 8:39
professionalJoan M22-Jan-03 8:39 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joaquín M López Muñoz22-Jan-03 9:01
Joaquín M López Muñoz22-Jan-03 9:01 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joan M22-Jan-03 9:22
professionalJoan M22-Jan-03 9:22 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joaquín M López Muñoz22-Jan-03 9:29
Joaquín M López Muñoz22-Jan-03 9:29 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joan M22-Jan-03 9:37
professionalJoan M22-Jan-03 9:37 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joaquín M López Muñoz22-Jan-03 9:42
Joaquín M López Muñoz22-Jan-03 9:42 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joan M22-Jan-03 9:54
professionalJoan M22-Jan-03 9:54 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Tim Smith22-Jan-03 10:02
Tim Smith22-Jan-03 10:02 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
Joan M22-Jan-03 10:06
professionalJoan M22-Jan-03 10:06 

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.