Click here to Skip to main content
15,913,934 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
Hey Joaquin! Thank you so much for all the hard work on my behalf! I like your solution better...I was adding a fake item from the resource editor and doing a remove or deletemenu on it...

I guess your method is a little different from what I found: (no CreatePopupMenu)
void CMainFrame::OnMakemenu() 
{
 // Get the menu from the application window.
   CMenu* mmenu = GetMenu();

   // Look for "File" menu.
   int pos = FindMenuItem(mmenu, "test dyn");
   if (pos == -1)
      return;

   // Remove "New" menu item from the File menu.
   CMenu* submenu = mmenu->GetSubMenu(pos);
 //  pos = FindMenuItem(submenu, "&New\tCtrl+N");
  // if (pos > -1)
 //     submenu->RemoveMenu(pos, MF_BYPOSITION);
	// TODO: Add your command handler code here
   pos = FindMenuItem(submenu, "junk");
      if (pos > -1)
      submenu->RemoveMenu(pos, MF_BYPOSITION);


	submenu->AppendMenu(MF_STRING, 0, "Dog");
}

int CMainFrame::FindMenuItem(CMenu *Menu, LPCTSTR MenuString)
{
ASSERT(Menu);
   ASSERT(::IsMenu(Menu->GetSafeHmenu()));

   int count = Menu->GetMenuItemCount();
   for (int i = 0; i < count; i++)
   {
      CString str;
      if (Menu->GetMenuString(i, str, MF_BYPOSITION) &&
         (strcmp(str, MenuString) == 0))
         return i;
   }

   return -1;

}


MAny many thanks!!!! Big Grin | :-D


Appreciate your help,
ns
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 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
peterchen22-Jan-03 9:19
peterchen22-Jan-03 9:19 
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:25
professionalJoan M22-Jan-03 9:25 
GeneralRe: MFC42D.DLL can be supplied with the application without being illegal? (I have real hurry to know this) Pin
David Chamberlain22-Jan-03 9:49
David Chamberlain22-Jan-03 9:49 
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:56
professionalJoan M22-Jan-03 9:56 

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.