79612790

Date: 2025-05-08 16:12:53
Score: 1.5
Natty:
Report link

I have the exact same code (not including the ObBnClickedButton1) for an About menu item to pop up an About modal dialog from the main program dialog window. I see the ID value coming from the system is 0XF095. That is AFX_IDS_UNKNOWNTYPE from <afxres.h>. If I comment out the check for the menu in this method then the about dialog does display properly. So how is the system sending me an UNKNOWNTYPE?

//A selection from the menu (Just "About" for now)
void CguiDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
    //the About menu item was selected and this should popup the About Dialog here
    if ((nID & 0xFFF0) == IDM_ABOUTBOX)
    {
        CAboutDlg dlgAbout;
        dlgAbout.DoModal();
    }
    else
    {
        CDialogEx::OnSysCommand(nID, lParam);
    }
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: user1741276