首页上一页 1 下一页尾页 1 条记录 1/1页
8.3动态创建菜单里面范例8.1运行结果出错
发表在C语言图书答疑
2015-05-05
是否精华
是
否
版块置顶:
是
否
按照书本上操作,运行没问题,出来结果是出错
Debug Assertion Failed
Program:D:、、
File:afxwin.inl
Line:1023
For information on how your progran can cause an assertion failure,see the Visual C++ documentation
on asserts
Press Retry to debug the application
我看到光盘范例8.1程序里面最后还有这几条
BOOL CCreateMenuDlg::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// TODO: Add your specialized code here and/or call the base class
WPARAM MenuID = GetCurrentMessage()->wParam;
if(MenuID >= 1001)
{
if(MenuID == nID && nCode == CN_COMMAND)
{
CString Name;
GetMenu()->GetMenuString(MenuID,Name,MF_STRING);
MessageBox(Name);
}
}
return CDialog::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
但是书本上面没有这段代码
Debug Assertion Failed
Program:D:、、
File:afxwin.inl
Line:1023
For information on how your progran can cause an assertion failure,see the Visual C++ documentation
on asserts
Press Retry to debug the application
我看到光盘范例8.1程序里面最后还有这几条
BOOL CCreateMenuDlg::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
// TODO: Add your specialized code here and/or call the base class
WPARAM MenuID = GetCurrentMessage()->wParam;
if(MenuID >= 1001)
{
if(MenuID == nID && nCode == CN_COMMAND)
{
CString Name;
GetMenu()->GetMenuString(MenuID,Name,MF_STRING);
MessageBox(Name);
}
}
return CDialog::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
但是书本上面没有这段代码