[Newbie] Is a MDI solution appropriate here? - Programmer

This is a discussion on [Newbie] Is a MDI solution appropriate here? - Programmer ; Hi Everyone, I am currently writing my first "real" application using MFC, and being extremely new to the subject I would like some reassurance that what I am attempting to do is actually possible using an MDI-style application. Lets start ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [Newbie] Is a MDI solution appropriate here?

  1. [Newbie] Is a MDI solution appropriate here?

    Hi Everyone,

    I am currently writing my first "real" application using MFC, and
    being extremely new to the subject I would like some reassurance that
    what I am attempting to do is actually possible using an MDI-style
    application.

    Lets start with what I want. I am trying to construct an app that
    displays images from two framegrabbers (each image in a separate
    window) as well as a modeless dialog box that will contain controls
    for the framegrabbers as well as the imagers to which they are
    attached.

    The modeless dialog box is not a problem (well not too much of a
    problem), however my understanding of the document/view model leaves
    me wondering if what I want to do with two image windows is possible.
    I have the sneaking feeling that I am going to have to use OpenGL or
    the like to display the images, even though they are nothing but raw
    16-bit pixel data.

    Could someone with more experience than me (practically everyone)
    please let me know if what I propose is sensible or not? I was
    originally thinking about having a dialog-based app where everything
    is displayed on the one dialog, but because the raw images are
    1280x1024 I thought it would be much better to have them in separate
    windows so they can be displayed "full size".

    Thanks for any replies.

  2. Re: [Newbie] Is a MDI solution appropriate here?

    In article <94387a7d.0407081615.622a4ed9@posting.google.com>,
    rodney.elliott@canterbury.ac.nz (Rodney B. Elliott) wrote:

    > I am currently writing my first "real" application using MFC, and
    > being extremely new to the subject I would like some reassurance that
    > what I am attempting to do is actually possible using an MDI-style
    > application.
    >
    > Lets start with what I want. I am trying to construct an app that
    > displays images from two framegrabbers (each image in a separate
    > window) as well as a modeless dialog box that will contain controls
    > for the framegrabbers as well as the imagers to which they are
    > attached.
    >
    > The modeless dialog box is not a problem (well not too much of a
    > problem), however my understanding of the document/view model leaves
    > me wondering if what I want to do with two image windows is possible.
    > I have the sneaking feeling that I am going to have to use OpenGL or
    > the like to display the images, even though they are nothing but raw
    > 16-bit pixel data.
    >
    > Could someone with more experience than me (practically everyone)
    > please let me know if what I propose is sensible or not? I was
    > originally thinking about having a dialog-based app where everything
    > is displayed on the one dialog, but because the raw images are
    > 1280x1024 I thought it would be much better to have them in separate
    > windows so they can be displayed "full size".


    MDI would put all your subwindows inside a single rectangular Frame
    window. This is a problem for people who have multiple CRTs that aren't
    all the same size. They don't have a rectangular desktop. I remember
    reading somewhere in Microsoft's documentation Microsoft saying that MDI
    is deprecated for just that reason, but I don't remember exactly where I
    read it.

    You'd be better off making your modeless dialog box the main window,
    with the menu bar, and putting the images in separate top level windows
    with scrollbars and zoom-in, zoom-out controls.

    That way, also, if you need to draw with OpenGL instead of GDI, the
    changes are localized to just the code that maps from images to windows.
    The rest of the program doesn't know or care.

    Document/View won't get in your way: the Document of your app, as
    described, has two images, each displayed in its own view. The Document
    also has all the parameters that your dialog box controls.

  3. Re: [Newbie] Is a MDI solution appropriate here?

    Thanks for your reply David.

    I like what you have suggested - making the framegrabber images
    top-level windows so they can be dragged across to different monitors
    sounds really good. I have a few questions regarding the rest of your
    suggestion however:

    1. Would I be right in inferring you advocate the use of a form-based
    main window (the main frame with the menus et cetera) instead of my
    current modeless dialog box?

    2. Are you suggesting that the two imager windows have their own menus
    which create modeless dialog boxes that provide image "tweaking"
    controls?

    I have never created a project with multiple top-level windows before,
    so I am not sure what they can do.

  4. Re: [Newbie] Is a MDI solution appropriate here?

    Sorry David,

    This is the second followup to your reply in case it turns up before
    the first. I have been thinking a bit more about what you said and
    have a few more questions about MDI and the multiple top-level
    paradigm:

    1. Is it possible to have an application with multiple top-level
    documents that are not identical? I have just had a play with the
    wizard, and the top-level documents are all the same, even when I make
    the base class CFormView.

    2. Is it possible to have an application that has one form-style
    window, and others that are not?

    I am still feeling my way around figuring out what you can and cannot
    do with MFC and am not sure what is and is not possible...

  5. Re: [Newbie] Is a MDI solution appropriate here?

    In article <94387a7d.0407141501.132dc46e@posting.google.com>,
    rodney.elliott@canterbury.ac.nz (Rodney B. Elliott) wrote:

    > 1. Is it possible to have an application with multiple top-level
    > documents that are not identical? I have just had a play with the
    > wizard, and the top-level documents are all the same, even when I make
    > the base class CFormView.
    >
    > 2. Is it possible to have an application that has one form-style
    > window, and others that are not?
    >
    > I am still feeling my way around figuring out what you can and cannot
    > do with MFC and am not sure what is and is not possible...


    I'm no expert, but here are some places to look:

    Read the source code:

    doctempl.cpp has the source for CDocTemplate

    docsingl.cpp for CSingleDocTemplate

    docmulti.cpp for CMultiDocTemplate

    docmgr.cpp for CDocManager

    winfrm.cpp, winfrm2.cpp, and winfrmx.cpp for CFrameWnd

    and of course, start with the online help for those classes.

+ Reply to Thread