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. Why my MDI application closes when I close a dialog box inside?

Why my MDI application closes when I close a dialog box inside?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
3 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.
  • S Offline
    S Offline
    saravana001
    wrote on last edited by
    #1

    Hi, I am working on a MDI application. I use CDaoDatabase (so I include AFXDAO.h) for my application. After doing some manipulation wiht the data, I close my dialog box, which has a "Close" button with the ID "IDCANCEL". So, when I close my dialog box, the whole application is getting closed. But the dialogs which are not using this afxdao.h is working fine. That means, it closes only the dialog and not the application. Could anyone, please help me in this regard. PS: I am using VC++ 6.0. Thanks in advance. Regards saravana

    R J 2 Replies Last reply
    0
    • S saravana001

      Hi, I am working on a MDI application. I use CDaoDatabase (so I include AFXDAO.h) for my application. After doing some manipulation wiht the data, I close my dialog box, which has a "Close" button with the ID "IDCANCEL". So, when I close my dialog box, the whole application is getting closed. But the dialogs which are not using this afxdao.h is working fine. That means, it closes only the dialog and not the application. Could anyone, please help me in this regard. PS: I am using VC++ 6.0. Thanks in advance. Regards saravana

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #2

      Put a breakpoint on CMainFrame::OnClose()...then in debug mode look at the call stack to understand why you reach that point of the code.:~ Hope it helps


      Russell

      1 Reply Last reply
      0
      • S saravana001

        Hi, I am working on a MDI application. I use CDaoDatabase (so I include AFXDAO.h) for my application. After doing some manipulation wiht the data, I close my dialog box, which has a "Close" button with the ID "IDCANCEL". So, when I close my dialog box, the whole application is getting closed. But the dialogs which are not using this afxdao.h is working fine. That means, it closes only the dialog and not the application. Could anyone, please help me in this regard. PS: I am using VC++ 6.0. Thanks in advance. Regards saravana

        J Offline
        J Offline
        jk chan
        wrote on last edited by
        #3

        may be the dialog sends PostQuitMessage() , what type of dialog is that and it is dervied from ?

        If u can Dream... U can do it

        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