Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. displaying dialog in MDIParent when it's loaded

displaying dialog in MDIParent when it's loaded

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
10 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    venadder
    wrote on last edited by
    #1

    Hi, I created a MFC doc/view application. 1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything. 2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed. I am really enw and have done readings and stuff onlien but nothing seem to point in right direction. Any pointers towards this? Any help is appreciated Thanks

    K C 2 Replies Last reply
    0
    • V venadder

      Hi, I created a MFC doc/view application. 1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything. 2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed. I am really enw and have done readings and stuff onlien but nothing seem to point in right direction. Any pointers towards this? Any help is appreciated Thanks

      K Offline
      K Offline
      kiran janaswamy
      wrote on last edited by
      #2

      hi ven, for this approach follow this steps you will get. 1) in OnInitialUpdate(...) of the MDI Form call a SendMessage(...,Functionname(...))/PostMessage(...,Functionname(...)) in the FunctionName(...) initiate the Dialog Dlgname d; d.DoModel(...); thats it! you will get Cheers and You will get it. good luck.. uday. uday kiran

      V 1 Reply Last reply
      0
      • V venadder

        Hi, I created a MFC doc/view application. 1. When the main window( the mdi ) is loaded it displays a empty chiled form. I don't want it to display anything. 2.Now I have dialog which i want to dock along the bottom of the parent window when it's displayed. I am really enw and have done readings and stuff onlien but nothing seem to point in right direction. Any pointers towards this? Any help is appreciated Thanks

        C Offline
        C Offline
        Cool Ju
        wrote on last edited by
        #3

        Hi, Add cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing; in Initinstance(). Bye, Cool Ju :cool: Dream Ur Destiny

        V 1 Reply Last reply
        0
        • C Cool Ju

          Hi, Add cmdInfo.m_nShellCommand =CCommandLineInfo::FileNothing; in Initinstance(). Bye, Cool Ju :cool: Dream Ur Destiny

          V Offline
          V Offline
          venadder
          wrote on last edited by
          #4

          hey thanks cool ju, that FileNothign worked like a charm. am still trying to show up the dialog thou

          C 1 Reply Last reply
          0
          • K kiran janaswamy

            hi ven, for this approach follow this steps you will get. 1) in OnInitialUpdate(...) of the MDI Form call a SendMessage(...,Functionname(...))/PostMessage(...,Functionname(...)) in the FunctionName(...) initiate the Dialog Dlgname d; d.DoModel(...); thats it! you will get Cheers and You will get it. good luck.. uday. uday kiran

            V Offline
            V Offline
            venadder
            wrote on last edited by
            #5

            where is this OnInitialUpdate sorry am new to MFC.

            V 1 Reply Last reply
            0
            • V venadder

              where is this OnInitialUpdate sorry am new to MFC.

              V Offline
              V Offline
              venadder
              wrote on last edited by
              #6

              I did that man. here is the problem first if i get rid of the startup child form, the CGUIView OnInitialUpdate does not even get called, so that code do nothing. Second i have no idea how to use SendMessage but this is what i did: void CQCProGUIView::OnInitialUpdate( ) { LoadLaunchBar( ); } int CQCProGUIView::LoadLaunchBar( ) { m_launchbar = new CLaunchBar( ); m_launchbar->DoModal( ); return 0; } now this what this does is basically the application runs, but i don't seee anything at all( not even main MDi form ). if i replace that with: m_launchbar->ShowWindow( SW_NORMAL); the following assertion fails: BOOL CWnd::ShowWindow(int nCmdShow) { ASSERT(::IsWindow(m_hWnd) || (m_pCtrlSite != NULL)); if (m_pCtrlSite == NULL) return ::ShowWindow(m_hWnd, nCmdShow); else return m_pCtrlSite->ShowWindow(nCmdShow); } :confused:

              1 Reply Last reply
              0
              • V venadder

                hey thanks cool ju, that FileNothign worked like a charm. am still trying to show up the dialog thou

                C Offline
                C Offline
                Cool Ju
                wrote on last edited by
                #7

                Hi, Instead of Dialog use a DialogBar which can be docked like a toolbar. Create the dialog bar in MainFrm::OnCreate() function and dock it where ever you want. Adios, Cool Ju :cool: Dream Ur Destiny

                V 1 Reply Last reply
                0
                • C Cool Ju

                  Hi, Instead of Dialog use a DialogBar which can be docked like a toolbar. Create the dialog bar in MainFrm::OnCreate() function and dock it where ever you want. Adios, Cool Ju :cool: Dream Ur Destiny

                  V Offline
                  V Offline
                  venadder
                  wrote on last edited by
                  #8

                  how do you dock, actually I am using a dialog bar I thoguht docking was not possible , so i was doign poisitioning and sizing myself.\ how would you suggest I try docking?

                  C 1 Reply Last reply
                  0
                  • V venadder

                    how do you dock, actually I am using a dialog bar I thoguht docking was not possible , so i was doign poisitioning and sizing myself.\ how would you suggest I try docking?

                    C Offline
                    C Offline
                    Cool Ju
                    wrote on last edited by
                    #9

                    Hi, You have to the dock the dialogbar using SetWindowPos() function. I suggest you to do in MainFrm class not in View class. Insert a dialog and change the style to child. Declare a CDialogbar object(eg: m_dlgbar) in MainFrm.h In MainFrm::OnCreate funtion m_dlgBar.Create(this, Id of the dialog template,CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY,id of the dialog template); m_dlgBar.SetWindowPos(&m_wndStatusBar, x,y,cx,cy,SWP_NOSIZE|SWP_NOMOVE); Adios, Cool Ju :cool: Dream Ur Destiny

                    V 1 Reply Last reply
                    0
                    • C Cool Ju

                      Hi, You have to the dock the dialogbar using SetWindowPos() function. I suggest you to do in MainFrm class not in View class. Insert a dialog and change the style to child. Declare a CDialogbar object(eg: m_dlgbar) in MainFrm.h In MainFrm::OnCreate funtion m_dlgBar.Create(this, Id of the dialog template,CBRS_LEFT|CBRS_TOOLTIPS|CBRS_FLYBY,id of the dialog template); m_dlgBar.SetWindowPos(&m_wndStatusBar, x,y,cx,cy,SWP_NOSIZE|SWP_NOMOVE); Adios, Cool Ju :cool: Dream Ur Destiny

                      V Offline
                      V Offline
                      venadder
                      wrote on last edited by
                      #10

                      A couple fo things: 1. The object was a CDialog so I changed the base class to CDialogBar 2.I used following code m_launchbar->Create( this,IDD_LAUNCHBAR,CBRS_BOTTOM ,IDD_LAUNCHBAR ); this docs the window fine at the bottom without any setting of position and size using the SetWindowPos. Now what happens is every button on the dialogbar is disabled and it took away the WinXp kind of look from the buttons too!!! Any ideas, am reading MSDN too on this. Thanks for your help , it was awesome

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups