Click here to Skip to main content
15,885,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: While Statement Issue. Pin
Mike Certini12-Jan-11 18:17
Mike Certini12-Jan-11 18:17 
QuestionDisabling popup menu item Pin
David Crow12-Jan-11 8:01
David Crow12-Jan-11 8:01 
AnswerRe: Disabling popup menu item PinPopular
User 742933812-Jan-11 8:29
professionalUser 742933812-Jan-11 8:29 
GeneralRe: Disabling popup menu item [SOLVED] Pin
David Crow12-Jan-11 8:54
David Crow12-Jan-11 8:54 
AnswerRe: Disabling popup menu item Pin
Niklas L12-Jan-11 21:18
Niklas L12-Jan-11 21:18 
QuestionRe: Disabling popup menu item Pin
David Crow14-Jan-11 3:20
David Crow14-Jan-11 3:20 
AnswerRe: Disabling popup menu item [modified] Pin
Niklas L16-Jan-11 20:47
Niklas L16-Jan-11 20:47 
AnswerRe: Disabling popup menu item Pin
JohnCz14-Jan-11 12:56
JohnCz14-Jan-11 12:56 
Well, there is always a lot of ways to skin a cat.
I would use my MEMC approach (Maximum Effect Minimum Code).
Your code does not use MFC update command UI mechanism, since you tell framework not to. Your code tells the framework to handle the popup menu directly in a view. View does not handle command update UI.
Change one line (or one expression) in your code to:

pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, pt.x, pt.y, AfxGetMainWnd());


This will start proper menu handles search and UI updates.
You eliminate a need to handle disabling menu items before calling TrackPopupMenu; morover, if you add menu items and handlers you will never have to change a code that disables menu items before displaying popup.
JohnCz
MS C++ MVP

Questionpreallocating logging files for performance purposes Pin
Alan Kurlansky12-Jan-11 4:36
Alan Kurlansky12-Jan-11 4:36 
AnswerRe: preallocating logging files for performance purposes Pin
Richard MacCutchan12-Jan-11 5:05
mveRichard MacCutchan12-Jan-11 5:05 
AnswerRe: preallocating logging files for performance purposes [modified] Pin
Andrew Brock12-Jan-11 5:15
Andrew Brock12-Jan-11 5:15 
AnswerRe: preallocating logging files for performance purposes Pin
jschell12-Jan-11 8:39
jschell12-Jan-11 8:39 
Questionhow to show bookmarks in a popupmenu? Pin
yogish29312-Jan-11 0:47
yogish29312-Jan-11 0:47 
AnswerRe: how to show bookmarks in a popupmenu? Pin
Richard MacCutchan12-Jan-11 1:09
mveRichard MacCutchan12-Jan-11 1:09 
GeneralRe: how to show bookmarks in a popupmenu? Pin
yogish29312-Jan-11 1:38
yogish29312-Jan-11 1:38 
GeneralRe: how to show bookmarks in a popupmenu? Pin
Richard MacCutchan12-Jan-11 1:42
mveRichard MacCutchan12-Jan-11 1:42 
GeneralRe: how to show bookmarks in a popupmenu? Pin
yogish29312-Jan-11 1:57
yogish29312-Jan-11 1:57 
GeneralRe: how to show bookmarks in a popupmenu? Pin
Richard MacCutchan12-Jan-11 2:20
mveRichard MacCutchan12-Jan-11 2:20 
GeneralRe: how to show bookmarks in a popupmenu? Pin
Maximilien12-Jan-11 2:54
Maximilien12-Jan-11 2:54 
AnswerRe: how to show bookmarks in a popupmenu? Pin
User 742933812-Jan-11 1:14
professionalUser 742933812-Jan-11 1:14 
QuestionHow to create a Floating Image over another Image ? Pin
002comp12-Jan-11 0:46
002comp12-Jan-11 0:46 
AnswerRe: How to create a Floating Image over another Image ? Pin
Cool_Dev12-Jan-11 1:23
Cool_Dev12-Jan-11 1:23 
GeneralRe: How to create a Floating Image over another Image ? Pin
002comp12-Jan-11 1:52
002comp12-Jan-11 1:52 
GeneralRe: How to create a Floating Image over another Image ? Pin
Cool_Dev12-Jan-11 2:22
Cool_Dev12-Jan-11 2:22 
QuestionGet Document IDispatch in native C++ (possibly using MFC ActiveX Control) [modified] Pin
T210211-Jan-11 21:37
T210211-Jan-11 21:37 

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.