我创建了一个多文档应用程序Test,然后在CTestApp的BOOL CGraDesApp::InitInstance()中将下列代码注释掉
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;然后为CChildFrame添加了一个OnFileNew();函数,在其中添加了
void CChildFrame::OnFileNew() 
{
// TODO: Add your command handler code here
if (!AfxGetApp()->OnCmdMsg(ID_FILE_NEW, 0, NULL, NULL))
OnFileNew();
ShowWindow(SW_SHOWMAXIMIZED );
}
但是第一次单击新建按钮时,新建的文档并不是最大化的,后面几次单击时新建的文档才会最大化。
我调试了程序,发现第一次单击新建按钮时,OnFileNew中的代码是不被执行的,请问第一次单击新建按钮时是哪个函数创建了文档呢?
我要怎么做才能使多文档程序在启动时不新建一个空文档,并且每次手动新建空文档时文档都被最大化呢?
请高人指教,谢谢!