MFC Document/View - New Milestone :: C++

This is a discussion on MFC Document/View - New Milestone :: C++ within the C++ Programming forums, part of the General Programming Boards category; Hi. I began and finished reading chapter 9 of Prosise's book on MFC today. I believe I have reached a ...

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348

    MFC Document/View - New Milestone :: C++

    Hi.

    I began and finished reading chapter 9 of Prosise's book on MFC today. I believe I have reached a milestone in the journey to become a proficient...good MFC programmer.

    Here is what I know.

    MFC = application object->frame window->view->documents

    Promise emphasized that documents as an abstract concept object including data. I interpret documents as dealing with the program's "purpose" i.e. program theme.

    Nonetheless, I have not come to a complete understanding as to what comes first: view or documents. For example, as program designer and developers, we should always walk the steps of a program user. I am not completely sure as to where is the clear separation of view and documents, event though view is the program interpreter. View does the drawing according to the data from documents.

    For example, let say I am working on a program that reads data from a file and puts it on a window in *binary* mode. Let say I create three classes using AppWizard and ClassWizard:

    1) ConceptPro (mainframe window)
    2) view
    3) document

    First, the classes above are MFC's generated classes.

    Conception is the application object and it handles all the taskbar, menu, etc.

    View draws the childframe, *binary* data from a file, etc.

    Documents handles the data such as filename, file data, etc.

    Is the description above valid? Please point out where I am "going off track" or "missed something important."

    Lastly, let say I have other classes that manipulate the data in the file *before* outputing it. Where should I instantiate these classes in documents or in view? I am not completely clear as to rank of document and view.

    Thanks,
    Kuphryn
    Last edited by kuphryn; 02-22-2002 at 02:15 PM.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    68
    view is below document. Doc holds all of the info for your file. View displays a portion of that info in different ways. You can have multiple views each showing a different portion of the data from the document. They could also be showing it in different ways...a graph from one, numbers for the other.
    ______________________
    The Gekko

  3. #3
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    Thanks.

    As I mentioned in the topic of "New Milestone," document/view architecture has shine light on my understanding of MFC. It gave me confident to push further (finish the book), and along the way, begin to take pay close attention and take notes for future projects (implement my C++ programs using MFC). I am not quite to that point yet, but MFC is beginning to come together nicely relative to my learning MFC.

    -----

    Multiple view per document: (AsmGuru62 also brought up this issue at programmersheaven)

    Lets consider the example AsmGuru62 mentioned about formatting data in text and HEX. As of chapter 10 in Prosise' book, he has not brought up the concept of multiple view. He did mention multiple documents as an upcoming topic, but not multiple view.

    First, for multiple view, do you approach it exactly the same way as singular view? Do you use ClassWizard to add a new derivative of CView or one of CView's derivative (scroll, etc.)?

    -----

    I am at a point with MFC where I see the *lego* pieces, but I have limited experience assembling the pieces together. That includes mapping related commands to related class derivatives, etc. I believe that comes with experience.

    Kuphryn

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MFC document/view woes
    By VirtualAce in forum Windows Programming
    Replies: 4
    Last Post: 03-15-2005, 06:54 AM
  2. Question about document/view app in MFC
    By hpy_gilmore8 in forum Windows Programming
    Replies: 2
    Last Post: 05-06-2004, 07:51 PM
  3. Document/View architecture help :: MFC
    By minesweeper in forum Windows Programming
    Replies: 1
    Last Post: 09-08-2003, 10:22 AM
  4. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08:52 PM
  5. Beginning MFC (Prosise) Part III - Now What? :: C++
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 03-03-2002, 05:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21