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. Modeless Dialog Ending Help needed

Modeless Dialog Ending Help needed

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelptutorialquestion
3 Posts 3 Posters 14 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.
  • B Offline
    B Offline
    Buck
    wrote on last edited by
    #1

    Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies

    U M 2 Replies Last reply
    0
    • B Buck

      Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies

      U Offline
      U Offline
      User 1052
      wrote on last edited by
      #2

      You could pass a pointer to your modal dialog up to its child modeless dialog. Then place a function in your modal dialog that will allow you to set your message. Then from your modeless dialog you can call that function before you call enddialog. ================== The original message was: Hi all,
      I have a Dialog based app that creates a Modal Dialog Box
      that then creates some modeless dialog's.
      What I need to know is when a modeless dialog exits,
      I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished
      with a EndDialog.

      Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done.

      Regardz

      Colin Davies

      1 Reply Last reply
      0
      • B Buck

        Hi all, I have a Dialog based app that creates a Modal Dialog Box that then creates some modeless dialog's. What I need to know is when a modeless dialog exits, I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished with a EndDialog. Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done. Regardz Colin Davies

        M Offline
        M Offline
        Michael Owen
        wrote on last edited by
        #3

        Colin, Do not use EndDialog() with Modeless Dialogboxes. What you need to do is override the OnOK() and OnCancel() methods and call DestroyWindow(). As for passing a message back to the parent dialogbox, all you need to do is have a "MyParent" variable and do the type cast back to the parent class. Ex: (( CYourClassHere *) MyParent)->VariableOrMethodHere; ** Note ** : This assumes that your dialogs are CWnd based. - Mike P.S. - Any other questions - drop me an e-mail or pop a rely to this message ... ================== The original message was: Hi all,
        I have a Dialog based app that creates a Modal Dialog Box
        that then creates some modeless dialog's.
        What I need to know is when a modeless dialog exits,
        I wish it to pass a message back to the Modal Dialog when the modeless dialog Box has been finished
        with a EndDialog.

        Sorry for this being a simple question. But I have looked through a stack of samples, And couldn't find an example of this being done.

        Regardz

        Colin Davies

        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