模式对话框的一个按钮中能不能调用CWinApp类的OnFileNew函数,如何调用?

wftttt 2017-04-11 09:02:58
我想实现的功能是 在多文档视图程序中,点击主窗口“新建”菜单,然后弹出一个对话框,在对话框的几个编辑框中设置参数后,点击“确定”按钮,在子框架窗口中创建一张表并显示,但是我在对话框的按钮处理函数中不知道如何调用CWinApp类的OnFileNew函数,或者说不知道能不能调用,所以感觉没办法继续下去了,请大神们指导!
...全文
843 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wftttt 2017-04-12
  • 打赏
  • 举报
回复
引用 1 楼 xianglitian 的回复:
OnFileNew没有任何实际意义,只是框架预留的接口 调用是可以的,但是调用它干嘛呢, 相关功能还是要你自己实现
主要是我搞不清楚OnFileNew的工作过程,这个相关功能我不知道怎么实现,不知道具体步骤,所以才想着调用这个接口函数,求指导
赵4老师 2017-04-12
  • 打赏
  • 举报
回复
仅供参考: WM_COMMAND The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. WM_COMMAND wNotifyCode = HIWORD(wParam); // notification code wID = LOWORD(wParam); // item, control, or accelerator identifier hwndCtl = (HWND) lParam; // handle of control Parameters wNotifyCode Value of the high-order word of wParam. Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0. wID Value of the low-order word of wParam. Specifies the identifier of the menu item, control, or accelerator. hwndCtl Value of lParam. Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL. Return Values If an application processes this message, it should return zero. Remarks Accelerator keystrokes that select items from the window menu are translated into WM_SYSCOMMAND messages. If an accelerator keystroke occurs that corresponds to a menu item when the window that owns the menu is minimized, no WM_COMMAND message is sent. However, if an accelerator keystroke occurs that does not match any of the items in the window's menu or in the window menu, a WM_COMMAND message is sent, even if the window is minimized. If an application enables a menu separator, the system sends a WM_COMMAND message with the low-word of the wParam parameter set to zero when the user selects the separator. QuickInfo Windows NT: Requires version 3.1 or later. Windows: Requires Windows 95 or later. Windows CE: Requires version 1.0 or later. Header: Declared in winuser.h. See Also Edit Controls Overview, Edit Control Messages, WM_SYSCOMMAND
向立天 2017-04-12
  • 打赏
  • 举报
回复
OnFileNew没有任何实际意义,只是框架预留的接口 调用是可以的,但是调用它干嘛呢, 相关功能还是要你自己实现

2,586

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 资源
社区管理员
  • 资源
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧