一般在启动MDI程序时,会自动新建一个视View并弹出。如果想要阻止可以按照一下方法:
在C**App类的InitInstance()中添加如下代码:
CCommandLineInfo cmdInfo;
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;//阻止启动时自动创建View
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
实际上只是插入了这行代码:
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;