Please Answer This Code Gurus.
How do I call up a CFormview dialog resource?
My App is a SDI with Form View, I have used all the space I want to and now I need a new Form view ( empty ) to start putting more controls on. So I Insert a new dialog in my resouces as a formview dialog and then base the class on CFormView.
I know how to call up a dialog "boz" with DoModal but what do I do to call up my new form?
Re: Please Answer This Code Gurus.
You can add your form view to your App's doctemplate in InitInstence(). For example:
CMyApp::InitInstance()
{
// .......
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMyFormView)); // your formview class
AddDocTemplate(pDocTemplate);
// 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;
}
Normally, the cmdInfo.m_nShellCommand is "FileNew". So, your app will create a new form view for you at start up.
Hope this will help. Good luck.
Allen