CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2006
    Location
    Minneapolis, Minnesota
    Posts
    33

    Question MFC SDI and Dialog Boxes

    I want to create an application that has 5 dialog type windows in an SDI format. I need the dialog tabs so that the user can click on the different dialog window tab. Furthermore, I can not have any two dialog boxes visible at any one time.

    Using the project wizard, I chose an SDI application and created 5 dialog boxes. I used InitDialog to maximize each Window.

    Unfortunately, only the active dialog window shows. I can't see the other four windows in a tab-type style.

    What am I doing wrong?

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: MFC SDI and Dialog Boxes

    Any reason you need SDI? Sounds like you want a basic dialog app, but instead of a main dialog window, use a CPropertySheet.

  3. #3
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: MFC SDI and Dialog Boxes

    May be you find this interesting.

  4. #4
    Join Date
    Dec 2006
    Location
    Minneapolis, Minnesota
    Posts
    33

    Re: MFC SDI and Dialog Boxes

    The app needs a menu bar.

    Each dialog is a sub app in and of itself.

    It needs the ability to full desktop maximize and minimize (although I can work around it.)

    I am using a menu View option where the view selection activates each dialog box.

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: MFC SDI and Dialog Boxes

    Quote Originally Posted by werpa
    Each dialog is a sub app in and of itself.
    What do you mean by that?

  6. #6
    Join Date
    Dec 2006
    Location
    Minneapolis, Minnesota
    Posts
    33

    Re: MFC SDI and Dialog Boxes

    Ejaz: Thanks for the link. It looks like a solution using CControlBar.

  7. #7
    Join Date
    Dec 2006
    Location
    Minneapolis, Minnesota
    Posts
    33

    Re: MFC SDI and Dialog Boxes

    GCDEF: Each dialog box is modal because it displays results from a separate engine running beneath the dialog. Only one of the 5 engines can run at any one time. The SDI ties the different engines together; but the engines can't be linked -- thus the need for 5 modal dialog boxes.

  8. #8
    Join Date
    May 1999
    Location
    ALABAMA, USA
    Posts
    9,917

    Re: MFC SDI and Dialog Boxes

    5 modal dialog boxes?
    You cannot have multiple numbers of modal dialog boxes and access all at any time. Only one is accessible while the rest stay disabled.
    Besides, how do you create 5 modal dialogs? From a timer? Message handler?

    I think you are referring to modeless dialogs and furthermore I suspect that they are not dialogs but views derived from CFormView.

    Please correct me if I am wrong.
    There are only 10 types of people in the world:
    Those who understand binary and those who do not.

  9. #9
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    56

    Wink Re: MFC SDI and Dialog Boxes

    WERPA: i agree with Johncz...why dont you create modeless dialog boxes and update their contents at run time. Each showing and updateing a shared/interlinked data in its own controls.

  10. #10
    Join Date
    Feb 2000
    Location
    Indore, India
    Posts
    1,046

    Re: MFC SDI and Dialog Boxes

    Hello,

    Either you can use a dialog box application using Propertysheets & Propertypage or use a view structure with tab control.

    Regards,
    Pravin.
    Let me know if I have helped by rating this post

    Recent FAQs

    Drag an image
    Area of a window exposed on desktop
    Display rotated bitmap

  11. #11
    Join Date
    Dec 2006
    Location
    Minneapolis, Minnesota
    Posts
    33

    Re: MFC SDI and Dialog Boxes

    Hello everyone:

    EJAZ's link above gave me exactly what I wanted: I have five Tabbed Windows in a SDI document. I can easily switch between all five windows be clicking on the tab. No two windows can interact with the user at the same time. I created my windows by inheriting from CView and CFormView.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured