MFC OnFileNew problem

Jul 30, 2009 at 10:42pm
I recently started a Word style application in MFC that utilises an MDI template. The way that the documents for it are saved though require extra information than what the default CRichEditView normally handles. To take care of this problem I overloaded the OnFileNew event. The problem I have though is that I don't know how to actually make the new file. I know how to get existing files using the GetDocument method but that's about it. Here is the code that I have so far for the overload.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
void CTimeCapsuleView::OnFileNew()
{
	// TODO: Add your command handler code here
	CSetDateDlg dlg;

	if( dlg.DoModal() == IDOK )
	{
		CTimeCapsuleDoc *pDoc = I don't know what goes here!;

		pDoc->SetTitle( _T("Title") );
		pDoc->m_Version;
		pDoc->m_Signature;
		pDoc->m_PresentDate = dlg.m_PresentDate;
		pDoc->m_OpenDate = dlg.m_OpenDate;
	}
} 
Last edited on Jul 30, 2009 at 10:43pm
Jul 31, 2009 at 2:04pm
Never mind I figured out what I was doing wrong. I should have been modifying the PreCreateWindow method of my view class.
Topic archived. No new replies allowed.