Enable/Disable Ribbon Menu Item Dynamically
-
Hi,java has
-
Hi,java has
madhuresh sachan wrote:
after this line cursor goes direct to the end of function,does not read below given code
What does this mean? How did you know that the code is not read (executed would be a better word) if not using the debugger? Your code snippet contains no operation that changes any GUI element (enables/disables items) so that you would not 'see' anything. So run your program in the debugger and check what happens (e.g. by inspecting
pRibbon
, initialpos
,lstItems.GetCount()
, and the loop execution). -
madhuresh sachan wrote:
after this line cursor goes direct to the end of function,does not read below given code
What does this mean? How did you know that the code is not read (executed would be a better word) if not using the debugger? Your code snippet contains no operation that changes any GUI element (enables/disables items) so that you would not 'see' anything. So run your program in the debugger and check what happens (e.g. by inspecting
pRibbon
, initialpos
,lstItems.GetCount()
, and the loop execution).Thanks for your reply pRibbon->GetItemIDsList(lstItems); In "lstItems" all the items of menu is coming, But the Main Problem is when I run this on debug mode,it is not executing the code after "pRibbon->GetItemIDsList(lstItems);" line of code.
-
Thanks for your reply pRibbon->GetItemIDsList(lstItems); In "lstItems" all the items of menu is coming, But the Main Problem is when I run this on debug mode,it is not executing the code after "pRibbon->GetItemIDsList(lstItems);" line of code.
So when you set a breakpoint at the for loop after
pos = lstItems.GetHeadPosition();
that is not hit and execution is not stopped? That would be weird. I assume that you are using a debug build with all optimisations disabled. Otherwise, the compiler may optimise away the following lines because they effectively do nothing. To check this you can insert a
TRACE
statement inside the loop printingnElement
.