MFC does not force you to use document/views. Check out hello, mdi, and helloapp samples, they don't use it at all. Most MFC features can be used in non-document/view applications. You do lose features like print preview and of many OLE features when you don't go document/view.
scot@stingray.com 6/7/95
See section 7.1.5. for the details.
In SDI applications, the document is deleted when the application exits. In MDI applications, the document is deleted when the last view on the document is closed. To help keep your document SDI/MDI compatible, you should delete the document's data in the virtual DeleteContents() function, not in the destructor.
Richard Hazenberg, drmcode@euronet.nl, programmer.misc, 6/24/95
To add support for additional document types, you can create and register additional CMultiDocTemplate objects with your CWinApp derived object. This technique is illustrated in the MULTDOCS sample application. The general steps needed to add an additional document type to an MFC application are listed below:
CMultiDocTemplate* pDocTemplate2 = new CMultiDocTemplate( IDR_DOC2TYPE, RUNTIME_CLASS(CDoc2), RUNTIME_CLASS(CMDIChildWnd), RUNTIME_CLASS(CView2)); AddDocTemplate(pDocTemplate2);
MS FAQ, 6/25/95
The code below demonstrates how to retrieve a list of pointers to all CDocuments that were created using a CDocTemplate object.
In the code below, CMyApp is derived from CWinApp. The variable m_templateList is a CPtrList object that is a member of CWinApp, and it contains a list of pointers to all of the document templates (CDocTemplates). The CDocTemplate functions GetFirstDocPosition() and GetNextDoc() are used to iterate through the list of documents for each document template.
There are two public member functions of the CDocTemplate class that
are not documented in the reference manual or the online help. However, these are public
member functions defined in the CDocTemplate class and provide simple functionality for
traversing the list of open documents. These functions operate as follows:
MS FAQ, 6/25/95 NOTE: This is only valid for MFC 3.2 and lower, MFC 4.0 version follows->
mcontest@universal.com, email, 9/22/95
Add this call:
just before the call to ProcessShellCommand in the app's InitInstance.
lechner-cos1@kaman.com, email, 1/6/96