MDI in MFC, Conceptually

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Roger Lakner (mmm444_at_adelphia.net)
Date: 02/06/05


Date: Sat, 5 Feb 2005 16:38:46 -0800

This is what I understand the way MDI works in the MFC framework: the
wizard builds you a View class, Main and Child frame classes, the App
class, and a Document class. These classes represent types. And I can
have multiple instances of each type. For example, multiple documents
open simultaneously or multiple views of a document's data open
simultaneously. If I want to have my App work with multiple document
types or multiple View types, I realize I need to create a new
Document class or a new View class to manage these other types. Most
of the MDI sample applications in the documentation and in Prosise's
book show how to implement different View types for a single Document
type. And there are a couple of examples implementing multiple
Document types. And, once explained, these are relatively
straightforward to understand. Here is my question: how would I
implement the following scenario? My application would use one
document type, for example, a BMP image file. And the app requires
only one View type appropriate for displaying a BMP file. But it must
be able to open many such files and display them all at the same time,
each in its own window. This, it seems to me, is fundamentally
different from the sample apps I've seen because the document's data
changes over the course of the App's run (each time I load a new file)
and the view of each (old) set of data must remain constant while that
data changes and a new view of that new data is displayed. In fact, I
think this scenario is conceptually contrary to MDI as its implemented
in the MFC.

Am I missing something? or is this just very hard to implement in MFC?

Thanks in advance for any and all sagely advice and kind
consideration.

Roger



Relevant Pages

  • Re: Opening a file for processing in MFC
    ... and it works the same way in MFC as it does without using MFC. ... You need to say a bit more about the context of the app, but it works just fine, and I do ... OpenDocument handler for SDI or MDI. ...
    (microsoft.public.vc.mfc)
  • Re: can only change one windows client area?
    ... Ajay Kalra wrote: ... but you should not mess directly with MFC. ... I still have not understood if this app is ... If its MDI, you can resize the parent child frame. ...
    (microsoft.public.vc.mfc)
  • Re: What could cause ::MessageBox to fail?
    ... >> Do not delete the main window for your app like this. ... > Is it legal to _change_ the main window in an MFC app? ... an SDI app with multiple CFormView views. ...
    (microsoft.public.vc.mfc)
  • Re: GetDocument()->UpdateAllViews() not updating all views...
    ... I have an MDI application. ... one or more Views to that single document. ... I'm in a learning phase so I have this scribble type app where I'm ... (or if there are multiple ...
    (microsoft.public.vc.mfc)
  • Re: New to COM programming, where to start?
    ... I have a MFC (MDI) application, say B.exe, which has no COM support ... Now a I have to write a new app A.exe, ... Do you simply want your new application to support multiple document ...
    (microsoft.public.vc.mfc)