What happens is that when I click File->Cancel (for example) the OnPopupFileMenu method is called and only then.
That's not so surprising - you 've declared OnPopupFileMenu as a handler for the menu's commands.
The BEGIN_UPDATE_UI_MAP defines what UI elements (menu, toolbar etc) should be updated when using functions like UIEnable. You call functions like UIEnable when the state that defines the UI state changes - WTL does not call UI update handlers like MFC.
See these two[^] articles[^] by Mike Dunn - in fact, see all of his WTL articles, they're all good!
You probably want to handle the WM_INITMENUPOPUP message and check what menu's being popped up to set menu item statuses like that.[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Do you know the values of nEnable* before the menu is accessed? If so, call UIEnable when you know those values. CUpdateUI handles WM_INITMENUPOPUP and will set the menu item states accordingly.
If you must do this processing when the menu is accessed, handle WM_INITMENUPOPUP and call UIEnable in that handler. Be sure to call SetMsgHandled(false) so that the message is passed on to CUpdateUI.
Later i just add this to a STL map
for(pastIterater = locoDetailsList.begin();pastIterater != locoDetailsList.end();pastIterater++)
Will the memory occupied by locoValue get removed or there a memory leak.
How can i solve this........
No, it's not the best way - the best way would be to define an operator== for Student, then use the operator== defined for std::list. Also - isn't the 'name' member a std::string? In which case that has an operator==