tariq6000
asked on
Context Menu
Hi Experts,
I am trying to create a context menu. But a exception is coming.
Context menu is : File->Add
My code is
<code>
CMenu menu;
menu.LoadMenu(IDR_CONTEXT) ;
CMenu* pPopup = menu.GetSubMenu(0);
CWnd* pWndPopupOwner = this;
CMenu *mnuPopupMenu = pPopup->GetSubMenu(0);
ASSERT(mnuPopupMenu);
while(pWndPopupOwner->G etStyle() & WS_CHILD)
pWndPopupOwner = pWndPopupOwner->GetPare nt();
pPopup->TrackPopupMenu( TPM_LEFTAL IGN | TPM_RIGHTBUTTON,
point.x,
point.y,
AfxGetMainWnd(), NULL);
</code>
What is wrong with this?
I am trying to create a context menu. But a exception is coming.
Context menu is : File->Add
My code is
<code>
CMenu menu;
menu.LoadMenu(IDR_CONTEXT)
CMenu* pPopup = menu.GetSubMenu(0);
CWnd* pWndPopupOwner = this;
CMenu *mnuPopupMenu = pPopup->GetSubMenu(0);
ASSERT(mnuPopupMenu);
while(pWndPopupOwner->G
pWndPopupOwner = pWndPopupOwner->GetPare
pPopup->TrackPopupMenu(
point.x,
point.y,
AfxGetMainWnd(), NULL);
</code>
What is wrong with this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
That doesn't look correct.