MFC MDI
Docking Pane
Can be unchecked.
Pane | Header | Class | Description |
---|---|---|---|
Properties | PropertiesWnd.h | CPropertiesToolBar(CMFCToolBar), CPropertiesWnd(CDockablePane) | |
Output | OutputWnd.h | COutputList(CListBox), COutputWnd(CDockablePane) | |
Explorer | ViewTree.h | CViewTree(CTreeCtrl) | |
Class | ClassView.h | CClassToolBar(CMFCToolBar), CClassView(CDockablePane) | |
Class | FileView.h | CFileViewToolBar(CMFCToolBar), CFileView(CDockablePane) |
Application Look
Can be unchecked.
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2008)); ![日志文件夹](/assets/cpp/ApplicationLook.png)
Menu Printing (Printing and print preview)
No need to unchecked.
//Application.cpp
ON_COMMAND(ID_FILE_PRINT_SETUP, &CWinApp::OnFilePrintSetup)
//ApplicationView.h
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//ApplicationView.cpp
ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CView::OnFilePrintPreview)
BOOL CMFCApplication2View::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CMFCApplication2View::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CMFCApplication2View::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
Tabbed Documents & Ribbon
No need to unchecked.
Menu Style
No need to unchecked.
MFC Standard Style & Old MFC Class
当使用MFC classic Menu时,MFC向导创建的工程会使用MFC旧类,而非VS2008后发布的MFC新类,例如使用CWinApp而非CwinAppEx,使用CMDIFrameWnd类而非使用CMDIFrameWndEx类。
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
// TODO: Delete these three lines if you don't want the toolbar to be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
ActiveX controls
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
AfxOleTerm(FALSE);
Support Restart Manager 重新启动管理器支持
// support Restart Manager
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_ALL_ASPECTS;
#ifdef _MANAGED
// If the application is built using Common Language Runtime support (/clr):
// 1) This additional setting is needed for Restart Manager support to work properly.
// 2) In your project, you must add a reference to System.Windows.Forms in order to build.
System::Windows::Forms::Application::SetUnhandledExceptionMode(System::Windows::Forms::UnhandledExceptionMode::ThrowException);
#endif
- 如果发生意外关闭或重启,重新启动管理器将为你的应用程序添加支持。 重新启动管理器的行为取决于应用程序的类型。 如果你的应用程序是文档编辑器,则重新启动管理器让应用程序能够自动保存任何打开文档的状态和内容,并在意外关闭后重启应用程序。 如果你的应用程序不是文档编辑器,则重新启动管理器将重启该应用程序,但无法默认保存应用程序的状态
- 重启后,如果应用程序采用 Unicode 编码,则该应用程序将显示任务对话框。 如果是 ANSI 应用程序,则该应用程序将显示 Windows 消息框。 此时,用户可以选择是否要还原自动保存的文档。 如果用户不还原自动保存的文档,则重新启动管理器将放弃临时文件
- 可以重写重新启动管理器保存数据和重启应用程序的默认行为
Common Control Manifest
不加的话,你的程序在 XP 上,使用的是旧的效果,就是那些按钮啊什么的全是老式的 加了的话,你的按钮神马的全是 XP 那种效果了, 可以取消选中。
Simplest MFC MDI Project
- Project template: MFC App
- Project style: MFC standard
- Classic menu options: none
- Advanced features: All unchecked