I'm trying to get a popup menu working in my dialog app, I'm almost directly copying the code from a VC++ E-book that I got from a link on these forums, but I've run into a problem
the code :
void CAboutDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu *m_lMenu; // A pointer to the menu
CPoint m_pPoint; // A copy of the mouse position
m_pPoint = point; // Copy mouse position to a local variable
ClientToScreen(&m_pPoint); // Convert to an absolute screen position
m_lMenu - GetMenu(); //Get a pointer to the window menu
m_lMenu = m_lMenu->GetSubMenu(0); //Get a pointer to the first submenu
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN + TPM_RIGHTBUTTON, m_pPoint.x, m_pPoint.y, this, NULL);//show the popup menu
}
the problem comes on the line
m_lMenu - GetMenu(); //Get a pointer to the window
I get the following warning
warning C4552: '>>' : operator has no effect; expected operator with side-effect
then a complaint that m_lMenu is being used on the next line without being initialized
Although the app compiles and runs OK, there is no popup menu functionality
Thanks
Merry christmas to all those who help !