C
Charlie CSP-Florida
Guest
I am trying to create a popup menu that shows when the user right clicks in a dialog box. The coding was originally coded in Visual Studio 6.0 to match existing systems. Adding the coding to Visual Studio 2017 returns the same results.
I have created a popup menu with three items to show. the following coding is added to show the menu when the right button is pressed. The menu appears but, instead of showing the three items a slim menu with just one space for each entry appears. If I click on the entry, it functions properly.
I have added coding to be able to see that the menu has the proper items and number of entries. I use a breakpoint to examine the responses and they show the proper entries.
The menu looks like this (without the spaces between the lines):
| |
| |
| |
_________________________________________________________
CMenupMenu;
pMenu.LoadMenu(IDR_TESTMENU);
// For testing that menu item is loaded correctly
// debug shows correct values
intiHold;
CStringHoldStr;
iHold = pMenu.GetMenuItemCount(); // Returns 3
pMenu.GetMenuString(1, HoldStr, MF_BYPOSITION); // Returns Item1
pMenu.GetMenuString(2, HoldStr, MF_BYPOSITION); // Returns Item2
pMenu.GetMenuString(3, HoldStr, MF_BYPOSITION); // Returns Item3
pMenu.TrackPopupMenu(TPM_TOPALIGN| TPM_LEFTALIGN, iMenuX, iMenuY, this, NULL);
pMenu.DestroyMenu();
Continue reading...
I have created a popup menu with three items to show. the following coding is added to show the menu when the right button is pressed. The menu appears but, instead of showing the three items a slim menu with just one space for each entry appears. If I click on the entry, it functions properly.
I have added coding to be able to see that the menu has the proper items and number of entries. I use a breakpoint to examine the responses and they show the proper entries.
The menu looks like this (without the spaces between the lines):
| |
| |
| |
_________________________________________________________
CMenupMenu;
pMenu.LoadMenu(IDR_TESTMENU);
// For testing that menu item is loaded correctly
// debug shows correct values
intiHold;
CStringHoldStr;
iHold = pMenu.GetMenuItemCount(); // Returns 3
pMenu.GetMenuString(1, HoldStr, MF_BYPOSITION); // Returns Item1
pMenu.GetMenuString(2, HoldStr, MF_BYPOSITION); // Returns Item2
pMenu.GetMenuString(3, HoldStr, MF_BYPOSITION); // Returns Item3
pMenu.TrackPopupMenu(TPM_TOPALIGN| TPM_LEFTALIGN, iMenuX, iMenuY, this, NULL);
pMenu.DestroyMenu();
Continue reading...