CWinApp :: OpenDocumentFile创建一个新窗口 [英] CWinApp::OpenDocumentFile creates a new window
问题描述
最近我们移动了我们的C ++项目,它使用MFC,从VS2008到VS2010。
Recently we moved our C++ project, which uses MFC, from VS2008 to VS2010.
还有一个小问题:在我们的MDI接口,函数CWinApp :: OpenDocumentFile,该应用程序不仅打开文件,而且还创建一个新的空MDI窗口。
And there is a small issue: in our MDI interface, after we call a function CWinApp::OpenDocumentFile, the app not only opens the file, but also creates a new empty MDI window.
如果我们更改工具集>平台工具集)回到v90(VS2008),我们不会遇到这个问题。
If we change the toolset (Project properties -> General -> Platform toolset) back to v90 (VS2008), we do not experience this problem.
也许有人看到同样的问题,知道我们做错了什么? p>
Maybe someone saw the same issue and knows, what we are doing wrong?
推荐答案
解决。也许这个解释会帮助别人:
Solved. maybe the explanation will help someone:
问题出现在MFC函数中:
The problem was in MFC function:
CDocument* CDocManager::OpenDocumentFile(LPCTSTR lpszFileName)
p>
in VS2008 it called a function
return pBestTemplate->OpenDocumentFile(szPath);
它调用另一个函数(参数数量不同)
in VS2010 it calls another function (with different number of parameters)
return pBestTemplate->OpenDocumentFile(szPath, bAddToMRU, TRUE);
我们没有在我们自己的CMultiDocTemplate实现中覆盖
which we didn't override in our own implementation of CMultiDocTemplate
这篇关于CWinApp :: OpenDocumentFile创建一个新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!