Click here to Skip to main content
15,902,635 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: bitmap from scrolview Pin
free2cric28-Apr-06 2:17
free2cric28-Apr-06 2:17 
QuestionGetting the installation directory in WinXP Pin
Parthiban27-Apr-06 20:07
Parthiban27-Apr-06 20:07 
AnswerRe: Getting the installation directory in WinXP Pin
Naveen27-Apr-06 20:23
Naveen27-Apr-06 20:23 
GeneralRe: Getting the installation directory in WinXP Pin
Nishad S27-Apr-06 20:46
Nishad S27-Apr-06 20:46 
QuestionWhat are the steps of firing Drag Drop event in a ListBox Pin
crazymubashir27-Apr-06 20:03
crazymubashir27-Apr-06 20:03 
AnswerRe: What are the steps of firing Drag Drop event in a ListBox Pin
Nibu babu thomas27-Apr-06 20:38
Nibu babu thomas27-Apr-06 20:38 
QuestionRe: What are the steps of firing Drag Drop event in a ListBox Pin
crazymubashir28-Apr-06 22:42
crazymubashir28-Apr-06 22:42 
QuestionPopup menu - First menu item - SetCheck Pin
Sarvan AL27-Apr-06 19:46
Sarvan AL27-Apr-06 19:46 
Hi all,

I have toolbar with a button as popup menu. It has two menu items, On and Off. I have main menu "Switch" with menu items On and Off.

When I click on Switch -> On, it gets checked. But the toolbar button also pushed. This is because the popup menu should have the same ID as first menu item. I want only the first menu item checked not the toolbar button to be pushed.

Pls refer the MSDN lines:
*************************************************
Nested Pop-up Menus

If you are using a nested menu structure, you will notice that the ON_UPDATE_COMMAND_UI handler for the first menu item in the pop-up menu is called in two different cases.

First, it is called for the pop-up menu itself. This is necessary because pop-up menus do not have IDs and we use the ID of the first menu item of the pop-up menu to refer to the entire pop-up menu. In this case, the m_pSubMenu member variable of the CCmdUI object will be non-NULL and will point to the pop-up menu.

Second, it is called just before the menu items in the pop-up menu are to be drawn. In this case, the ID refers just to the first menu item and the m_pSubMenu member variable of the CCmdUI object will be NULL.
*************************************************

void CMainFrame::OnUpdateSwitchOn(CCmdUI* pCmdUI) <br />
{<br />
// to avoid toolbar pop-up menu to get updated<br />
pCmdUI->SetCheck((pCmdUI->m_pSubMenu == NULL) && SwitchOn) ;<br />
}<br />
<br />
void CMainFrame::OnUpdateSwitchOff(CCmdUI* pCmdUI) <br />
{<br />
	pCmdUI->SetCheck(!SwitchOn) ;<br />
}


How can we use CCmdUI members to solve this.

Thanks in advance,
Sarvan AL
QuestionInternet bandwidth Pin
Anilkumar K V27-Apr-06 19:11
Anilkumar K V27-Apr-06 19:11 
AnswerRe: Internet bandwidth Pin
David Crow28-Apr-06 2:44
David Crow28-Apr-06 2:44 
Questionhow to add a custom item to the right-click menu of Edit control? Pin
samfromcn27-Apr-06 18:58
samfromcn27-Apr-06 18:58 
AnswerRe: how to add a custom item to the right-click menu of Edit control? Pin
Nibu babu thomas27-Apr-06 19:11
Nibu babu thomas27-Apr-06 19:11 
QuestionBrowse for subfolder Pin
anjita27-Apr-06 18:07
anjita27-Apr-06 18:07 
AnswerRe: Browse for subfolder Pin
Nishad S27-Apr-06 18:48
Nishad S27-Apr-06 18:48 
QuestionOPC connection Pin
Anu_Bala27-Apr-06 17:48
Anu_Bala27-Apr-06 17:48 
AnswerRe: OPC connection Pin
QuickDeveloper27-Apr-06 18:09
QuickDeveloper27-Apr-06 18:09 
QuestionRe: OPC connection Pin
David Crow28-Apr-06 2:48
David Crow28-Apr-06 2:48 
QuestionC++ syntax question Pin
includeh1027-Apr-06 17:45
includeh1027-Apr-06 17:45 
AnswerRe: C++ syntax question Pin
Aqueel27-Apr-06 17:51
Aqueel27-Apr-06 17:51 
GeneralRe: C++ syntax question Pin
includeh1027-Apr-06 19:36
includeh1027-Apr-06 19:36 
GeneralRe: C++ syntax question Pin
Aqueel27-Apr-06 21:41
Aqueel27-Apr-06 21:41 
AnswerRe: C++ syntax question Pin
Nishad S27-Apr-06 19:09
Nishad S27-Apr-06 19:09 
GeneralRe: C++ syntax question Pin
includeh1027-Apr-06 19:37
includeh1027-Apr-06 19:37 
GeneralRe: C++ syntax question Pin
toxcct27-Apr-06 22:28
toxcct27-Apr-06 22:28 
AnswerRe: C++ syntax question Pin
Michael Dunn27-Apr-06 19:46
sitebuilderMichael Dunn27-Apr-06 19:46 

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.