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. One class with Multiple IDDs (is this possible)

One class with Multiple IDDs (is this possible)

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
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.
  • K Offline
    K Offline
    kitty5
    wrote on last edited by
    #1

    I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do: if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){} The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...

    Kitty5

    C D 2 Replies Last reply
    0
    • K kitty5

      I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do: if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){} The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...

      Kitty5

      C Offline
      C Offline
      cje
      wrote on last edited by
      #2

      could you put all of your handlers in to a single class derived from CDialog (I'm assuming MFC here) and then have the dialogs derive from your handler class? class HandlerClass : public CDialog { } class Dialog1 : public HandlerClass { } class Dialog2 : public HandlerClass { }

      cje

      1 Reply Last reply
      0
      • K kitty5

        I've created an MDI application that has test.cpp and test.h in it. I've created an IDD (which is a form) called IDD_TEST and declared it in test.h under the //Dialog Data as: enum { IDD = IDD_TEST }; How does one link multiple IDDs ( i.e. if I create IDD_TEST1 ) to 1 class (test.h and test.cpp) so that the variables and event handlers for the controls of both IDDs are located in test.h and test.cpp and I can use them together. (i.e. if m_nCheckBoxTest is in IDD_TEST and m_nCheckBoxTest1 is in IDD_TEST1 I can do: if(m_nCheckBoxTest.GetCheck() == 1 && m_nCheckBoxTest1.GetCheck() == 1){} The dilema is I can't fit everything into just 1 form for my I&T GUI....(even with scroll bars enabled...) Please help...

        Kitty5

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

        Are you sure you want to do this? Our product currently has this scenario in several places and it is a nightmare to maintain, especialy where help is involved. Just this week I separated one of the .h/.cpp pairs so that each was using its own dialog template. The dialog templates are almost identical so the original author thought it would be neat if only one class serviced both templates. Yuck!


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        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