如何防止MSVC在MFC中创建默认的空选项卡 [英] How to prevent MSVC to create default empty tab in MFC
本文介绍了如何防止MSVC在MFC中创建默认的空选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用MFC Visual Studio MutliTab界面.
在应用程序启动时,Visual Studio为我们提供了一个默认的视图选项卡.
我想防止创建此选项卡..
为此,我尝试了..
I am working on MFC Visual Studio MutliTab interface.
On application start, the visual studio provides us one default view tab.
I want to prevent this tab being created..
for this, what i tried..
BOOL CProjectManagerView::PreCreateWindow(CREATESTRUCT& cs)
{
return CView::PreCreateWindow(cs);
}
我遇到了
i commeted
return CView::PreCreateWindow(cs);
并返回FALSE
但是在运行时,它显示消息无法创建空文档"
所以,我想知道..
阻止它创建默认的空选项卡的步骤是什么?
and returned FALSE
But on run, it displays message, "Failed to create empty document"
So, i want to know..
what are the steps to prevent it from creating an default empty tab?
推荐答案
在主应用程序文件中,找到"InitInstance". br/> 在那里,找到一个说类似声音的地方:
In your main app file, find "InitInstance".
There, find a place where it says somomething like:
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MyTYPE,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CMyView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
注释不要创建默认选项卡.
希望对您有所帮助.
Comment that not to create a default tab.
Hope it helps.
这篇关于如何防止MSVC在MFC中创建默认的空选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文