我正在将一些旧的C ++代码从旧的构建环境(VS2003)转移到(略微)更新的(VS2010) - 由于各种原因,较新的IDE不合适。我正在尝试用尽可能少的变化来构建它。
它从已保存的文件中加载一组视图。我注意到,当在VS2010上构建时,总会有一个额外的视图。我得出结论,这个版本的MFC必须创建一个初始视图,而旧版本则没有。
我想已经加载了所有我可以移除不需要的视图,但是我想知道是否有更简洁的方法让它不首先创建不需要的视图?
答案 0 :(得分:1)
查看应用程序初始化类中的一些template<typename T, typename = std::enable_if_t<std::is_integral<T>::value() > 0>>
调用。可能你会将一些旧代码与向导生成的代码混合在一起。
答案 1 :(得分:0)
我认为你有一个MDI应用程序,在
之间// 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;
你应该简单地说:
// suppress automatic creation of child window
if(CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
并且在启动时,您将没有新的视图/ doc。