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. Is there an equivalent function to "DoModal()" for modeless dialogs?

Is there an equivalent function to "DoModal()" for modeless dialogs?

Scheduled Pinned Locked Moved C / C++ / MFC
question
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
    julych
    wrote on last edited by
    #1

    Let's say I have two buttons: ID_BUTTON_START ID_BUTTON_END - is there a way (such as "if(myDlg.DoModal() == IDOK)..." to indicate that first or second button was pressed for a modeless dialog?

    N J 2 Replies Last reply
    0
    • J julych

      Let's say I have two buttons: ID_BUTTON_START ID_BUTTON_END - is there a way (such as "if(myDlg.DoModal() == IDOK)..." to indicate that first or second button was pressed for a modeless dialog?

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      You could always use a bool varible within the class to keep track of this. -Nick Parker

      1 Reply Last reply
      0
      • J julych

        Let's say I have two buttons: ID_BUTTON_START ID_BUTTON_END - is there a way (such as "if(myDlg.DoModal() == IDOK)..." to indicate that first or second button was pressed for a modeless dialog?

        J Offline
        J Offline
        John M Drescher
        wrote on last edited by
        #3

        If I need to store state data from a modeless dialog box I usually pass a pointer to my CDocument and store it there. Otherwise when a button is pressed I send a command message to my main view window. This way the dialog can delete itself in the PostNcDestroy function without worrying about some function trying to look at data stored in the dialog class after it has been destroyed. John

        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