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. Handling Cdialog's in a App.

Handling Cdialog's in a App.

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelpquestion
4 Posts 4 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.
  • D Offline
    D Offline
    Donguy1976
    wrote on last edited by
    #1

    Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.

    L D 2 Replies Last reply
    0
    • D Donguy1976

      Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Just add some code so that every time a dialog opens it calls in to a central function which can keep track of them. If these are all modal dialogs I would be interested to know how the app has multiple ones open at the same time.

      Use the best guess

      1 Reply Last reply
      0
      • D Donguy1976

        Hello All, I have a MFC app developed in VS 6.0 User can open multiple dialogs in this app. Is there a way of keeping track of how many dialogs are open at a given time? Also, is there a way of getting the handle to each dialog from a central location? Because the dialogs are opened from different parts of the app, i.e., different files its hard to keep track of all dialogs. Any sample code will help. Thanks in advance.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Derive all of your dialogs from a common class. In that base class, override OnInitDialog() and OnCancel() to adjust your counters accordingly.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        H 1 Reply Last reply
        0
        • D David Crow

          Derive all of your dialogs from a common class. In that base class, override OnInitDialog() and OnCancel() to adjust your counters accordingly.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          H Offline
          H Offline
          H Brydon
          wrote on last edited by
          #4

          DavidCrow wrote:

          Derive all of your dialogs from a common class. In that base class, override OnInitDialog() and OnCancel() to adjust your counters accordingly.

          More specifically, write a new class MyCDialog which derives from CDialog, and implements OnInitDialog() and OnCancel() as DavidCrow describes, then change all of your existing dlg classes that derive from CDialog to derive from MyCDialog. [Specifically, if a class doesn't derive from CDialog directly, then don't change it.]

          -- Harvey

          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