Click here to Skip to main content
15,916,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Comparing Two Bitmap Pin
Hamid_RT30-Apr-06 19:32
Hamid_RT30-Apr-06 19:32 
QuestionWake on Lan (WOL) Pin
kiran janaswamy27-Apr-06 2:31
kiran janaswamy27-Apr-06 2:31 
AnswerRe: Wake on Lan (WOL) Pin
Ravi Bhavnani27-Apr-06 4:54
professionalRavi Bhavnani27-Apr-06 4:54 
QuestionPop up blocker designing problem Pin
captaincse27-Apr-06 2:31
captaincse27-Apr-06 2:31 
AnswerRe: Pop up blocker designing problem Pin
James R. Twine27-Apr-06 3:03
James R. Twine27-Apr-06 3:03 
GeneralRe: Pop up blocker designing problem Pin
captaincse28-Apr-06 21:14
captaincse28-Apr-06 21:14 
Questionnmake to build dll Pin
Shiva Prasad27-Apr-06 2:05
Shiva Prasad27-Apr-06 2:05 
QuestionDisable the menu Pin
Anu_Bala27-Apr-06 0:45
Anu_Bala27-Apr-06 0:45 
Hi,
I have lot of confusion in deleting the Menu command.Ihave one program as to select 4 different operators.Corresponding to each operator the menus will get changed.

BOOL COprStation::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
m_cOprSt.AddString("AAA");
m_cOprSt.AddString("BBB");
m_cOprSt.AddString("CCC");
m_cOprSt.AddString("DDD");

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void COprStation::OnOK()
{
// TODO: Add extra validation here
UpdateData();
gsCurModelName.Empty();
int iSel = m_cOprSt.GetCurSel();
if( iSel == LB_ERR)
{
AfxMessageBox("Select operator station to configure");
m_cOprSt.SetFocus();
return;
}
gOprStation = -1;
sOprStExt = _T("");

CMenu* pMenu = AfxGetMainWnd()->GetMenu();
// pMenu->DeleteMenu(ID_FCS_DISPLAY,MF_BYCOMMAND);

/* CString sStr=_T("");
int iMenuItemCount = ((CMenu *)AfxGetMainWnd()->GetMenu())->GetMenuItemCount();

for (int j=0;j<imenuitemcount;j++)
{
="" ((cmenu="" *)afxgetmainwnd()-="">GetMenu())->GetMenuString(j,sStr,MF_BYPOSITION);
if (sStr.CompareNoCase("&Panel Config") == 0)
{
// ((CMenu *)AfxGetMainWnd()->GetMenu())->DeleteMenu(j,MF_BYPOSITION);
((CMenu *)AfxGetMainWnd()->GetMenu())->EnableMenuItem(j,MF_DISABLED |MF_GRAYED);
}
}*/

switch(iSel)
{
case 0:
{
CMenu* pGrowingMenu = pMenu->GetSubMenu(2);
//pGrowingMenu->DestroyMenu();
pGrowingMenu->InsertMenu(3,MF_STRING,ID_DISPLAY_FUNCTIONKEY,"&Function Key");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_OVR_DISPLAY,"&OverView Config");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_GRAPHCONFIG,"G&raphics Page Config");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_DISPLAY_GROUPTREND,"Group && Trend");

}
case 1:
{
CMenu* pGrowingMenu = pMenu->GetSubMenu(2);
//pGrowingMenu->DestroyMenu();
pGrowingMenu->InsertMenu(3,MF_STRING,ID_DISPLAY_FUNCTIONKEY,"&Function Key");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_OVR_DISPLAY,"&OverView Config");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_GRAPHCONFIG,"G&raphics Page Config");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_DISPLAY_GROUPTREND,"Group && Trend");
pGrowingMenu->InsertMenu(3,MF_STRING,ID_FCS_DISPLAY,"&FCS Display");

}
case 2:
{
CMenu* pFoxMenu = pMenu->GetSubMenu(2);
pFoxMenu->InsertMenu(3,MF_STRING,ID_GROUP_GRAPH_CONF,"GroupGraphics");
pFoxMenu->InsertMenu(3,MF_STRING,ID_FOX_ANNUN_KEYBOARD_CONF,"KeyBoard");
pFoxMenu->InsertMenu(3,MF_STRING,ID_FOX_DISPLAY_BAR,"Display Bar");
pFoxMenu->InsertMenu(3,MF_STRING,ID_FOX_MENU_CONFIG,"Disp Menu");
pFoxMenu->InsertMenu(3,MF_STRING,ID_FOX_MENU_DISP1_CONFIG,"Disp1 Menu");
pFoxMenu->InsertMenu(3,MF_STRING,ID_FOX_MENU_DISP2_CONFIG,"Disp2 menu");
//pFoxMenu->EnableMenuItem(ID_DISPLAY_FUNCTIONKEY,MF_DISABLED |MF_GRAYED);
//pFoxMenu->EnableMenuItem(ID_OVR_DISPLAY,MF_DISABLED |MF_GRAYED);
//pFoxMenu->EnableMenuItem(ID_GRAPHCONFIG,MF_DISABLED |MF_GRAYED);
//pFoxMenu->EnableMenuItem(ID_DISPLAY_GROUPTREND,MF_DISABLED |MF_GRAYED);
}
case 3:
{

// CMenu* pFODMenu = pMenu->GetSubMenu(2);
/*pFODMenu->DeleteMenu(6,MF_BYPOSITION);
pFODMenu->DeleteMenu(5,MF_BYPOSITION);
pFODMenu->DeleteMenu(4,MF_BYPOSITION);
pFODMenu->DeleteMenu(0,MF_BYPOSITION);*/
// pFODMenu->EnableMenuItem(ID_OVR_DISPLAY,MF_DISABLED |MF_GRAYED);
// pFODMenu->EnableMenuItem(ID_GRAPHCONFIG,MF_DISABLED |MF_GRAYED);
/*
CString sStr=_T("");
int iMenuItemCount = ((CMenu *)AfxGetMainWnd()->GetMenu())->GetMenuItemCount();

for (int j=0;j<imenuitemcount;j++)
{
="" ((cmenu="" *)afxgetmainwnd()-="">GetMenu())->GetMenuString(j,sStr,MF_BYPOSITION);
if (sStr.CompareNoCase("&Panel Config") == 0)
{
((CMenu *)AfxGetMainWnd()->GetMenu())->DeleteMenu(j,MF_BYPOSITION);
//((CMenu *)AfxGetMainWnd()->GetMenu())->EnableMenuItem(j,MF_DISABLED |MF_GRAYED);
}
}
DrawMenuBar();*/
// CMenu* menu = GetMenu();
/* CMenu* FODmenu = pMenu->GetSubMenu(2);// CWnd::GetMenu in the mainframe, for example
for(int i = 0; i < FODmenu->GetMenuItemCount(); i++)
{

FODmenu->EnableMenuItem( i, MF_DISABLED | MF_GRAYED);
}
DrawMenuBar();*/
CMenu* pFodMenu = pMenu->GetSubMenu(2);
pMenu->DeleteMenu(ID_FCS_DISPLAY,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_DISPLAY_FUNCTIONKEY,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_OVR_DISPLAY,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_GRAPHCONFIG,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_DISPLAY_GROUPTREND,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_GROUP_GRAPH_CONF,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_FOX_ANNUN_KEYBOARD_CONF,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_FOX_DISPLAY_BAR,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_FOX_MENU_CONFIG,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_FOX_MENU_DISP1_CONFIG,MF_BYCOMMAND);
pMenu->DeleteMenu(ID_FOX_MENU_DISP2_CONFIG,MF_BYCOMMAND);
break;
}
default:
return;
}
gOprStation = iSel;
CDialog::OnOK();
}

This is my coding..In Case 4,I dont want any menu.I followed lot of methods, but does not work.
Morethan that,if i select select the already selected operator once again,the menu gets growing.... I dont know wat to do..Pls HELP.
QuestionComparing colors-newbie Pin
antonaras_marcou27-Apr-06 0:05
antonaras_marcou27-Apr-06 0:05 
AnswerRe: Comparing colors-newbie Pin
Cedric Moonen27-Apr-06 0:14
Cedric Moonen27-Apr-06 0:14 
GeneralRe: Comparing colors-newbie Pin
antonaras_marcou27-Apr-06 0:23
antonaras_marcou27-Apr-06 0:23 
GeneralRe: Comparing colors-newbie Pin
Stephen Hewitt27-Apr-06 0:51
Stephen Hewitt27-Apr-06 0:51 
GeneralRe: Comparing colors-newbie Pin
antonaras_marcou27-Apr-06 2:49
antonaras_marcou27-Apr-06 2:49 
GeneralRe: Comparing colors-newbie Pin
BadKarma27-Apr-06 5:11
BadKarma27-Apr-06 5:11 
GeneralRe: Comparing colors-newbie Pin
antonaras_marcou27-Apr-06 8:07
antonaras_marcou27-Apr-06 8:07 
GeneralRe: Comparing colors-newbie Pin
Stephen Hewitt27-Apr-06 13:54
Stephen Hewitt27-Apr-06 13:54 
QuestionRe: Comparing colors-newbie Pin
David Crow27-Apr-06 3:10
David Crow27-Apr-06 3:10 
Questionproblem in triggering events Pin
rajeev8227-Apr-06 0:00
rajeev8227-Apr-06 0:00 
AnswerRe: problem in triggering events Pin
Cedric Moonen27-Apr-06 0:12
Cedric Moonen27-Apr-06 0:12 
AnswerRe: problem in triggering events Pin
Roger Stoltz27-Apr-06 0:34
Roger Stoltz27-Apr-06 0:34 
GeneralRe: problem in triggering events Pin
rajeev8227-Apr-06 0:54
rajeev8227-Apr-06 0:54 
AnswerRe: problem in triggering events Pin
Roger Stoltz27-Apr-06 1:00
Roger Stoltz27-Apr-06 1:00 
GeneralRe: problem in triggering events Pin
rajeev8227-Apr-06 1:19
rajeev8227-Apr-06 1:19 
AnswerRe: problem in triggering events Pin
Roger Stoltz27-Apr-06 2:50
Roger Stoltz27-Apr-06 2:50 
QuestionWaiting for the thread end Pin
gomez_a26-Apr-06 23:44
gomez_a26-Apr-06 23:44 

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.