我使用Visual Studio的应用程序向导来创建具有多文档界面的骨架MFC程序.当我启动这个程序时,它会自动创建一个子框架,我不希望它这样做 - 我需要主框架的客户区域为空,直到用户选择打开文件.
调试器告诉我,当应用程序类的InitInstance()函数调用ProcessShellCommand()时,会创建一个CChildFrame对象,但是什么是覆盖此行为的好入口点?
这是有效的,它保持从外壳打印/打开等.
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if ( cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew )
{
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing ;
}
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
Run Code Online (Sandbox Code Playgroud)