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

[复制链接]
查看11 | 回复3 | 2021-1-27 06:44:16 | 显示全部楼层 |阅读模式
我想实现的功能是在多文档视图程序中,点击主窗口“新建”菜单,然后弹出一个对话框,在对话框的几个编辑框中设置参数后,点击“确定”按钮,在子框架窗口中创建一张表并显示,但是我在对话框的按钮处理函数中不知道如何调用CWinApp类的OnFileNew函数,或者说不知道能不能调用,所以感觉没办法继续下去了,请大神们指导!
分 -->
回复

使用道具 举报

千问 | 2021-1-27 06:44:16 | 显示全部楼层
OnFileNew没有任何实际意义,只是框架预留的接口
调用是可以的,但是调用它干嘛呢,
相关功能还是要你自己实现
回复

使用道具 举报

千问 | 2021-1-27 06:44:16 | 显示全部楼层
仅供参考:
WM_COMMAND
TheWM_COMMANDmessageissentwhentheuserselectsacommanditemfromamenu,whenacontrolsendsanotificationmessagetoitsparentwindow,orwhenanacceleratorkeystrokeistranslated.
WM_COMMAND
wNotifyCode=HIWORD(wParam);//notificationcode
wID=LOWORD(wParam);//item,control,oracceleratoridentifier
hwndCtl=(HWND)lParam;//handleofcontrol
Parameters
wNotifyCode
Valueofthehigh-orderwordofwParam.Specifiesthenotificationcodeifthemessageisfromacontrol.Ifthemessageisfromanaccelerator,thisparameteris1.Ifthemessageisfromamenu,thisparameteris0.
wID
Valueofthelow-orderwordofwParam.Specifiestheidentifierofthemenuitem,control,oraccelerator.
hwndCtl
ValueoflParam.Handletothecontrolsendingthemessageifthemessageisfromacontrol.Otherwise,thisparameterisNULL.
ReturnValues
Ifanapplicationprocessesthismessage,itshouldreturnzero.
Remarks
AcceleratorkeystrokesthatselectitemsfromthewindowmenuaretranslatedintoWM_SYSCOMMANDmessages.
Ifanacceleratorkeystrokeoccursthatcorrespondstoamenuitemwhenthewindowthatownsthemenuisminimized,noWM_COMMANDmessageissent.However,ifanacceleratorkeystrokeoccursthatdoesnotmatchanyoftheitemsinthewindow'smenuorinthewindowmenu,aWM_COMMANDmessageissent,evenifthewindowisminimized.
Ifanapplicationenablesamenuseparator,thesystemsendsaWM_COMMANDmessagewiththelow-wordofthewParamparametersettozerowhentheuserselectstheseparator.
QuickInfo
WindowsNT:Requiresversion3.1orlater.
Windows:RequiresWindows95orlater.
WindowsCE:Requiresversion1.0orlater.
Header:Declaredinwinuser.h.
SeeAlso
EditControlsOverview,EditControlMessages,WM_SYSCOMMAND


回复

使用道具 举报

千问 | 2021-1-27 06:44:16 | 显示全部楼层
引用1楼xianglitian的回复:OnFileNew没有任何实际意义,只是框架预留的接口
调用是可以的,但是调用它干嘛呢,
相关功能还是要你自己实现

主要是我搞不清楚OnFileNew的工作过程,这个相关功能我不知道怎么实现,不知道具体步骤,所以才想着调用这个接口函数,求指导
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行