在一个MDI应用程序中,如果创建了多个模板,那么在应用程序运行之后会弹出一个显示模板名字的列表对话框。现在我想让这个对话框不显示,该怎么做?(所有模板中的文档都来自同一类)
----------------向最聪明的人请教
----------------向最聪明的人请教
解决方案 »
- 全局函数中如何获得主对话框的句柄?(全局函数中想使用主对话框中的函数)
- VS2010 加载ActiveX和VC6有什么不同????
- 回车换行如何不自动转换
- 下位机与上位机通信问题
- 从计算机如何读取windows mobile手机中的电子邮件
- 通过修改rc文件修改资源,如改变对话框的大小..编辑状态打开rc文件,直接修改,在线等!!!!
- 关于WritePrivateProfileSection的一个问题
- 专业性强的问题!!CDialogBar难道不能在基于对话框的程序中使用?
- 如何在基于对话框的工程中,向对话框中添加菜单条?
- 关于SNMP agent的几个问题
- OnCtlColor的错误问题?
- 有关网络超时的问题
{
public:
CSDI_Two_DocApp();
CSingleDocTemplate* pDocTemplate;
CSingleDocTemplate* pDocTemplate2;// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSDI_Two_DocApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL// Implementation
//{{AFX_MSG(CSDI_Two_DocApp)
afx_msg void OnAppAbout();
afx_msg void OnFileNew();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
----------------------------
BOOL CSDI_Two_DocApp::InitInstance()
{
AfxEnableControlContainer(); // Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif // Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications")); LoadStdProfileSettings(); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views. pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CSDI_Two_DocDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CSDI_Two_DocView));
AddDocTemplate(pDocTemplate); pDocTemplate2=new CSingleDocTemplate(
IDR_MENU_EDITVIEW,
RUNTIME_CLASS(CSDI_Two_DocDoc),
RUNTIME_CLASS(CEditFrame),
RUNTIME_CLASS(CWriteEdit));
AddDocTemplate(pDocTemplate2); // 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; // The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow(); return TRUE;
}
void CSDI_Two_DocApp::OnFileNew()
{
// TODO: Add your command handler code here
//you should specify the document template in here!
pDocTemplate->OpenDocumentFile(NULL)//avoid displaying the selection dialog
}