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. closing the opened dialog from cchildframe::OnClose()

closing the opened dialog from cchildframe::OnClose()

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
2 Posts 2 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
    Veeresh Hiremath
    wrote on last edited by
    #1

    Hi all, My application is an MDI application I have an "open" button in one dialog box , which upon click, opens up a child window . But one i close the child window , i need to close the dialog also . I know that i should handle within the CChildFrame::OnClose() function,but i dont't know how to get the dialog handle and close it. I have tried creating CMydialog *dlg in the CChildFrame class and invoking dlg->ShowWindow(SW_CLOSE), but the dialog is not closing Could you please tell me how to overcome this problem

    M 1 Reply Last reply
    0
    • V Veeresh Hiremath

      Hi all, My application is an MDI application I have an "open" button in one dialog box , which upon click, opens up a child window . But one i close the child window , i need to close the dialog also . I know that i should handle within the CChildFrame::OnClose() function,but i dont't know how to get the dialog handle and close it. I have tried creating CMydialog *dlg in the CChildFrame class and invoking dlg->ShowWindow(SW_CLOSE), but the dialog is not closing Could you please tell me how to overcome this problem

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Try dlg->DestroyWindow() instead. You also have to delete dlg at some point unless you've taken the steps to make the modeless dialog self deleting. Mark

      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