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. Destroying a dialog box.

Destroying a dialog box.

Scheduled Pinned Locked Moved C / C++ / MFC
debugginghelp
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.
  • J Offline
    J Offline
    John Uhlenbrock
    wrote on last edited by
    #1

    I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John

    C RaviBeeR 2 Replies Last reply
    0
    • J John Uhlenbrock

      I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John

      C Offline
      C Offline
      Carlos Antollini
      wrote on last edited by
      #2

      Use EndDialog() function. Cheers!!! :beer: Carlos Antollini.

      1 Reply Last reply
      0
      • J John Uhlenbrock

        I have a dialog box that I pop up as a progress indicator. There are two program modes, manual and automatic. In the manual mode, the user clicks ok when the progress is complete, which closes the progress dialog window. In automatic, when the progress is done, I need it to automatically close the dialog. The problem is, if I call DestroyWindow, without the user having clicked somewhere, I get a "User breakpoint called from [address]". Anybody had this problem before...seems kind of weird. - John

        RaviBeeR Offline
        RaviBeeR Offline
        RaviBee
        wrote on last edited by
        #3

        To programatically close the dialog, fake an OK (or Cancel) button-click by doing:

        PostMessage (WM_COMMAND, IDOK); // fake an OK
        Post Message (WM_COMMAND, IDCANCEL); // fake a Cancel

        This should cause your dialog to close as if the user clicked OK. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

        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