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. dialog in a class

dialog in a class

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

    Hi all, I need to know if there's a way to put a dialog as a data member of a class and, if it's possible, how. Thanx in advance, Desmo16.

    Z H 2 Replies Last reply
    0
    • D Desmo16

      Hi all, I need to know if there's a way to put a dialog as a data member of a class and, if it's possible, how. Thanx in advance, Desmo16.

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      Yes, and yes. It is no different than declaring any other data member (say, an int, for example). You just have to make sure that if your dialog class needs arguments passed to its constructor that you handle that appropriately.

      If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

      D 1 Reply Last reply
      0
      • Z Zac Howland

        Yes, and yes. It is no different than declaring any other data member (say, an int, for example). You just have to make sure that if your dialog class needs arguments passed to its constructor that you handle that appropriately.

        If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

        D Offline
        D Offline
        Desmo16
        wrote on last edited by
        #3

        well, it's great, but i don't understand what should i write in the class. If for example my dialog's idd is IDD_SORGENTE1 in the class should i write: public: IDD_SORGENTE1 varname; or what else ? In other words i don't know the datatype of a dialog and its name

        D Z 2 Replies Last reply
        0
        • D Desmo16

          well, it's great, but i don't understand what should i write in the class. If for example my dialog's idd is IDD_SORGENTE1 in the class should i write: public: IDD_SORGENTE1 varname; or what else ? In other words i don't know the datatype of a dialog and its name

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

          Are you wanting something like:

          #include "MyDialog.h"

          class myclass
          {
          CMyDialog dlg; // derived from CDialog
          };


          "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

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

          1 Reply Last reply
          0
          • D Desmo16

            well, it's great, but i don't understand what should i write in the class. If for example my dialog's idd is IDD_SORGENTE1 in the class should i write: public: IDD_SORGENTE1 varname; or what else ? In other words i don't know the datatype of a dialog and its name

            Z Offline
            Z Offline
            Zac Howland
            wrote on last edited by
            #5

            You need to create a class for your dialog first. If you use the classwizard, it will do it for you. You can then do what David mentioned in his post.

            If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

            1 Reply Last reply
            0
            • D Desmo16

              Hi all, I need to know if there's a way to put a dialog as a data member of a class and, if it's possible, how. Thanx in advance, Desmo16.

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              You insert a dialog to your resource and now you want to insert calss and data members to it,Right?

              _**


              **_

              WhiteSky


              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