为什么老是说不能读?请帮帮我
为什么添加了快捷方式,老是说不能读,编译通过,运行一按右键就说内存不能读,我不知道为什么?程序如下:
void CPainterView::OnContextMenu(CWnd* pWnd, CPoint point)
{
// TODO: Add your message handler code here
if(*DrawType==SELECT)
{
if(point.x==-1&&point.y==-1)
{ CRect rect;
GetClientRect(rect);
ClientToScreen(rect);
point=rect.TopLeft();
point.Offset(0,0);
}
CMenu menu;
VERIFY(menu.LoadMenu(IDR_CONTEXT_MENU));
CMenu*pPopup=menu.GetSubMenu(0);
ASSERT(pPopup!=NULL);
CWnd*pWndPopupOwner=this;
while(pWndPopupOwner->GetStyle()&WS_CHILD)
pWndPopupOwner=pWndPopupOwner->GetParent();
pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x
,point.y,pWndPopupOwner);
}
}