|
-
August 13th, 2009, 04:54 AM
#1
Menu event not working
Hi
i am making a dialog based project in MFC using VS2005. The problem is that i am craeting menu on button click As a click a button menu is open properly. but if i am given control on that pop up menu nothing happen.
i am giving some code.
plz help me.
this is the code on button click event
CMenu *pContextMenu=NULL ;
pContextMenu = menu.GetSubMenu (0);
CWnd* pWnd = GetDlgItem(IDC_NETSTAG);
if ( !pWnd )
return ;
CRect rect;
pWnd->GetWindowRect( &rect );
// Show the Menu
int nCmd = pContextMenu->TrackPopupMenu (TPM_LEFTALIGN |
TPM_RETURNCMD,
rect.left, rect.bottom,
AfxGetMainWnd() );
this is the code on menu handler
CSampleDlg::OnLogin
{
AfxMessageBox ("Baher jao");//this is not fire after displaing opup menu.
}
thanks .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|