It manages multiple documents (document/view documents, not MDI documents) and, in that capacity, remains useful for MTI without modification. The CMultiDocTemplate is still used by MTI because it does not include anything that is MDI-specific.
In most cases, it is not necessary to modify the code in OnInitInstance() method which instantiates the document template. You must remove the instantiation of the MDI frame window and all references to it from the application. The OnInitInstance() method typically includes code to instantiate a document template and the MDI frame window. The next step is to modify the OnInitInstance() method of your CWinApp-derived class. If you have a significant amount of code in your CMainFrame class, you need to consider moving the code to a new location. Because MTI has no equivalent to an MDI frame window, your CMainFrame class has no role in a MTI implementation. Remove the CMainFrame class and all references to it from your application.
This ensures that the MDI child windows retain all of their previous capabilities and can float freely on the desktop instead of being confined to the MDI frame window. Replace the base class of each existing MDI child frame ( CMDIChildWnd) with SECToplevelFrame. Replace the instantiation of a CSingleDocTemplate in the InitInstance() method of your CWinApp-derived class to CMultiDocTemplate.ġ0.2.2.3 To convert an existing MDI application to MTI Replace the base class of your CFrameWnd-derived class with SECToplevelFrame. 10.2.2.2 To convert an existing SDI application to MTI
The following sections describe how to create an MTI application from a new or existing MFC project. Figure 88: Objective Toolkit MTI Class Hierarchy The following figure is the hierarchy for SECToplevelFrame. MTI applications derive from SECToplevelFrame whereas an MDI application would derive from CMDIChildWnd. The SECToplevelFrame class is the basis for the MTI MDI-alternative. For example, you can easily activate MTI windows from the Windows 98 taskbar. It has also become a popular Windows interface.
This approach is common in other GUI operating systems such as the OSF/Motif windowing system for UNIX. MTI-based applications create document windows that float freely on the desktop. Figure 87: Example of an MTI Application (new document) However, note that when the user loads or creates document, an additional frame is created to hold the document instead of loading the document into the existing frame. MTI departs from the MDI model in which one parent frame owns and contains every document window.įrom the user's standpoint, an MTI application most closely resembles an SDI application because he can only associate one document with a frame. MTI creates a new top-level window for each new document. As in MDI, the user can have multiple documents open simultaneously.
As in SDI, each top-level window manipulates one document. 10.2.1 Multiple Top-level Interface (MTI) Objective Toolkit proves you with three additional alternatives: MTI, FDI, and WDI. Currently, MFC only supports the Multiple Document Interface (MDI) and Single-Document Interface (SDI), which are waning in popularity.
With the release of Windows 95, Microsoft made it known in The Windows Interface Guidelines for Software Design that they are moving away from MDI in their Office products however Microsoft has not provided Windows operating-system-level support or MFC support for any of the MDI alternatives described in their design guide.
Rogue Wave web site: Home Page | Main Documentation.