danielnogo
Programmer
Popup menus have been the bane of my existance in visual c++. Im following a tutorial that came with a cd I got and this is the code it gives me for OnContextMenu():
void CPopupMenuDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
// TODO: Add your message handler code here
CMenu *m_lMenu; // A pointer to the menu
CPoint m_pPoint; // A copy of the mouse position
m_pPoint = point;
// Convert the position to a screen position
ClientToScreen(&m_pPoint);
m_lMenu - GetMenu();
m_lMenu = m_lMenu->GetSubMenu(0);
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON,
m_pPoint.x, m_pPoint.y, this, NULL);
}
It doesnt work, I even pasted the code from the tutorial in my code, just to make sure I have it right. Heres the warnings I get:
warning C4552: '>>' : operator has no effect; expected operator with side-effect
local variable 'm_lMenu' used without having been initialized
Can anyone help?
void CPopupMenuDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
// TODO: Add your message handler code here
CMenu *m_lMenu; // A pointer to the menu
CPoint m_pPoint; // A copy of the mouse position
m_pPoint = point;
// Convert the position to a screen position
ClientToScreen(&m_pPoint);
m_lMenu - GetMenu();
m_lMenu = m_lMenu->GetSubMenu(0);
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_LEFTBUTTON,
m_pPoint.x, m_pPoint.y, this, NULL);
}
It doesnt work, I even pasted the code from the tutorial in my code, just to make sure I have it right. Heres the warnings I get:
warning C4552: '>>' : operator has no effect; expected operator with side-effect
local variable 'm_lMenu' used without having been initialized
Can anyone help?