Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/139.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MFC文档/视图体系结构-创建没有初始视图的文档 我将一些旧的C++代码从一个旧的构建环境(VS2003)转移到一个(稍微)更新的(VS2010)——一个新的IDE不适合于各种原因。我正在尽可能少的修改来构建它_C++_Visual Studio 2010_Mfc_Visual Studio 2003_Document View - Fatal编程技术网

MFC文档/视图体系结构-创建没有初始视图的文档 我将一些旧的C++代码从一个旧的构建环境(VS2003)转移到一个(稍微)更新的(VS2010)——一个新的IDE不适合于各种原因。我正在尽可能少的修改来构建它

MFC文档/视图体系结构-创建没有初始视图的文档 我将一些旧的C++代码从一个旧的构建环境(VS2003)转移到一个(稍微)更新的(VS2010)——一个新的IDE不适合于各种原因。我正在尽可能少的修改来构建它,c++,visual-studio-2010,mfc,visual-studio-2003,document-view,C++,Visual Studio 2010,Mfc,Visual Studio 2003,Document View,它从保存的文件加载一组视图。我注意到,在VS2010上构建时,总有一个额外的视图。我的结论是,这个版本的MFC必须创建一个初始视图,而旧版本没有 我想在加载了所有视图之后,我可以删除不需要的视图,但我想知道是否有一种更整洁的方法可以让它不首先创建不需要的视图?查看应用程序初始化类中的一些NewDocument()调用。可能您将一些旧代码与向导生成的代码混合在一起。如果您有一个MDI应用程序 // Parse command line for standard shell commands, DD

它从保存的文件加载一组视图。我注意到,在VS2010上构建时,总有一个额外的视图。我的结论是,这个版本的MFC必须创建一个初始视图,而旧版本没有


我想在加载了所有视图之后,我可以删除不需要的视图,但我想知道是否有一种更整洁的方法可以让它不首先创建不需要的视图?

查看应用程序初始化类中的一些
NewDocument()
调用。可能您将一些旧代码与向导生成的代码混合在一起。

如果您有一个MDI应用程序

// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);

你应该简单地说:

// suppress automatic creation of child window
if(CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
在启动时,您将不会有新的视图/文档

// suppress automatic creation of child window
if(CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
    cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;