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. Modal Dailog Box

Modal Dailog Box

Scheduled Pinned Locked Moved C / C++ / MFC
question
10 Posts 5 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.
  • P Offline
    P Offline
    ppathan
    wrote on last edited by
    #1

    How do i open an Dialog BOx from the SDI Main Frame Menu. I tried to use Do.Modal()with the Dialog class object , but it caused an assetion. If i ignore the assertion, it runs perfectly fine. I want to get rid of that assertion.

    V 1 Reply Last reply
    0
    • P ppathan

      How do i open an Dialog BOx from the SDI Main Frame Menu. I tried to use Do.Modal()with the Dialog class object , but it caused an assetion. If i ignore the assertion, it runs perfectly fine. I want to get rid of that assertion.

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      What causes the assertion? SDI menu has nothing to do with a dialog box. I suspect that the dialog box is not initialized correctly. Kuphryn

      P 1 Reply Last reply
      0
      • V valikac

        What causes the assertion? SDI menu has nothing to do with a dialog box. I suspect that the dialog box is not initialized correctly. Kuphryn

        P Offline
        P Offline
        ppathan
        wrote on last edited by
        #3

        I created an object of my Dialog class called Window.In order to open the dialog class i did Window.DoModal(); That is when assertion came up.

        D 1 Reply Last reply
        0
        • P ppathan

          I created an object of my Dialog class called Window.In order to open the dialog class i did Window.DoModal(); That is when assertion came up.

          D Offline
          D Offline
          Dave Bryant
          wrote on last edited by
          #4

          What is the assertion that occurred? Dave http://www.cloudsofheaven.org

          P 1 Reply Last reply
          0
          • D Dave Bryant

            What is the assertion that occurred? Dave http://www.cloudsofheaven.org

            P Offline
            P Offline
            ppathan
            wrote on last edited by
            #5

            assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().

            D R R 3 Replies Last reply
            0
            • P ppathan

              assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().

              D Offline
              D Offline
              Dave Bryant
              wrote on last edited by
              #6

              Can you post the code that you are using to create the dialog box as well please... it might make it a bit easier to see what is going on. Dave http://www.cloudsofheaven.org

              1 Reply Last reply
              0
              • P ppathan

                assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().

                R Offline
                R Offline
                Ravi Bhavnani
                wrote on last edited by
                #7

                It could be that your dialog contains a CWnd derived member that's not linked to a control. But it's impossible to say for sure unless you post some code. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

                P 1 Reply Last reply
                0
                • R Ravi Bhavnani

                  It could be that your dialog contains a CWnd derived member that's not linked to a control. But it's impossible to say for sure unless you post some code. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

                  P Offline
                  P Offline
                  ppathan
                  wrote on last edited by
                  #8

                  here is the Function that is used to create the dialog box when a SDI menu item is clicked.That menu item is called Jaguar. Jagwindow is my object for class CJaguarDlg. Hope this clarifies things. void CVR_ToolView::OnJaguar() { CJaguarDlg JagWindow; int nRet=JagWindow.DoModal(); }

                  R 1 Reply Last reply
                  0
                  • P ppathan

                    here is the Function that is used to create the dialog box when a SDI menu item is clicked.That menu item is called Jaguar. Jagwindow is my object for class CJaguarDlg. Hope this clarifies things. void CVR_ToolView::OnJaguar() { CJaguarDlg JagWindow; int nRet=JagWindow.DoModal(); }

                    R Offline
                    R Offline
                    Ravi Bhavnani
                    wrote on last edited by
                    #9

                    Sadly, that's of no help. How about posting the OnInitDialog() of CJaguarDlg. Also post its .h file. /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

                    1 Reply Last reply
                    0
                    • P ppathan

                      assertion says Debug Assertion failed. File:afxwin2.inl Line 162. i think it is due to some inappropraite use of function DoModal().

                      R Offline
                      R Offline
                      Ryan Binns
                      wrote on last edited by
                      #10

                      ppathan wrote: i think it is due to some inappropraite use of function DoModal(). No. Somewhere in your dialog or in one of the embedded controls, a RedrawWindow() is being called before the dialog is created properly, possibly in OnSize() or something like that. If you've put this in, then do this:

                      if(::IsWindow(m_hWnd))
                      RedrawWindow();

                      Hope this helps,

                      Ryan

                      "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

                      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