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. Call DialogB from DialogA

Call DialogB from DialogA

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++visual-studioquestion
15 Posts 5 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.
  • P pabloraul

    Hello everyone, i finished with yesterdays work and got a fully functional crytography class that builds perfectly and today im starting to write my dialog based aplication. i created a few dialogs and im trying to link them but i havent found how. i know its an easy question but still i would like a recomendation. in dialog A theres a button, when i press it i want to make dialog B appear on the screen, i've tryed the ->Create(); command but i think im using it wrong ps: the aplication is in C++ for visual studio 2005

    L Offline
    L Offline
    led mike
    wrote on last edited by
    #2

    pabloraul wrote:

    in dialog A theres a button, when i press it i want to make dialog B appear on the screen, i've tryed the ->Create(); command but i think im using it wrong

    So dialogA is showing when you run the application? If so then you have code that does shows a dialog, it's the same for DialogB, yes?

    Abandon hope all ye who answer here.

    Pete O'Hanlon - the General Discussions forum

    P 1 Reply Last reply
    0
    • L led mike

      pabloraul wrote:

      in dialog A theres a button, when i press it i want to make dialog B appear on the screen, i've tryed the ->Create(); command but i think im using it wrong

      So dialogA is showing when you run the application? If so then you have code that does shows a dialog, it's the same for DialogB, yes?

      Abandon hope all ye who answer here.

      Pete O'Hanlon - the General Discussions forum

      P Offline
      P Offline
      pabloraul
      wrote on last edited by
      #3

      yes, dialog A runs when the App starts the code is the following: CZEUSv2008Dlg(CWnd* pParent = NULL); CEncriptacion * dialogo_encriptar; but i dont know how to use it since im copying from a thing done like 10 years ago. i tried dialogo_encriptar->DestroyWindow(); dialogo_encriptar->Create(); but it gives me error c2027 for using an undefined class and a c2227 for the left part of the "->" must point to a class struct union or generic type im just plain confused with this

      L CPalliniC 2 Replies Last reply
      0
      • P pabloraul

        yes, dialog A runs when the App starts the code is the following: CZEUSv2008Dlg(CWnd* pParent = NULL); CEncriptacion * dialogo_encriptar; but i dont know how to use it since im copying from a thing done like 10 years ago. i tried dialogo_encriptar->DestroyWindow(); dialogo_encriptar->Create(); but it gives me error c2027 for using an undefined class and a c2227 for the left part of the "->" must point to a class struct union or generic type im just plain confused with this

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #4

        Ok, good luck

        led mike

        1 Reply Last reply
        0
        • P pabloraul

          yes, dialog A runs when the App starts the code is the following: CZEUSv2008Dlg(CWnd* pParent = NULL); CEncriptacion * dialogo_encriptar; but i dont know how to use it since im copying from a thing done like 10 years ago. i tried dialogo_encriptar->DestroyWindow(); dialogo_encriptar->Create(); but it gives me error c2027 for using an undefined class and a c2227 for the left part of the "->" must point to a class struct union or generic type im just plain confused with this

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #5

          Where you tried it? I mean, does the posted code belong to a single source file? Which line is the error c2027 for? Maybe you need to post more code.

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

          In testa che avete, signor di Ceprano?

          P 1 Reply Last reply
          0
          • CPalliniC CPallini

            Where you tried it? I mean, does the posted code belong to a single source file? Which line is the error c2027 for? Maybe you need to post more code.

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke

            P Offline
            P Offline
            pabloraul
            wrote on last edited by
            #6

            i asked my dad about it and he said it was from an old stupid class called "MyDlg" so he told me to find a new way to call dialogs. now that code and way of doing it its obsolet so if i acomplish solving this issue i solved the issue for all the dialogs that need to be called. already tryed to use the .DoModal(); thing but it didnt work

            modified on Wednesday, April 2, 2008 4:04 PM

            1 Reply Last reply
            0
            • P pabloraul

              Hello everyone, i finished with yesterdays work and got a fully functional crytography class that builds perfectly and today im starting to write my dialog based aplication. i created a few dialogs and im trying to link them but i havent found how. i know its an easy question but still i would like a recomendation. in dialog A theres a button, when i press it i want to make dialog B appear on the screen, i've tryed the ->Create(); command but i think im using it wrong ps: the aplication is in C++ for visual studio 2005

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

              pabloraul wrote:

              ...i think im using it wrong

              That all depends on if you want a modal or modeless dialog. If the former, use DoModal(), much like you are already doing in your app's InitInstance() method to bring up dialog A.

              "Love people and use things, not love things and use people." - Unknown

              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

              P 1 Reply Last reply
              0
              • D David Crow

                pabloraul wrote:

                ...i think im using it wrong

                That all depends on if you want a modal or modeless dialog. If the former, use DoModal(), much like you are already doing in your app's InitInstance() method to bring up dialog A.

                "Love people and use things, not love things and use people." - Unknown

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                P Offline
                P Offline
                pabloraul
                wrote on last edited by
                #8

                thenks for the idea, found an article about modal thingies

                D 1 Reply Last reply
                0
                • P pabloraul

                  thenks for the idea, found an article about modal thingies

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

                  pabloraul wrote:

                  an article about modal thingies

                  :doh: :rolleyes:

                  "Love people and use things, not love things and use people." - Unknown

                  "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                  I 1 Reply Last reply
                  0
                  • D David Crow

                    pabloraul wrote:

                    an article about modal thingies

                    :doh: :rolleyes:

                    "Love people and use things, not love things and use people." - Unknown

                    "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                    I Offline
                    I Offline
                    Iain Clarke Warrior Programmer
                    wrote on last edited by
                    #10

                    Think nice thoughts - we were all there once. Too long ago for me, I sometimes think! Iain.

                    Iain Clarke appears because CPallini still cares.

                    D 1 Reply Last reply
                    0
                    • I Iain Clarke Warrior Programmer

                      Think nice thoughts - we were all there once. Too long ago for me, I sometimes think! Iain.

                      Iain Clarke appears because CPallini still cares.

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

                      It wasn't his verbiage that bothered me (I'm from Oklahoma so I get accused of talking funny all the time). It was that he talked about modal while linking to a modeless article.

                      "Love people and use things, not love things and use people." - Unknown

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      I 1 Reply Last reply
                      0
                      • D David Crow

                        It wasn't his verbiage that bothered me (I'm from Oklahoma so I get accused of talking funny all the time). It was that he talked about modal while linking to a modeless article.

                        "Love people and use things, not love things and use people." - Unknown

                        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                        I Offline
                        I Offline
                        Iain Clarke Warrior Programmer
                        wrote on last edited by
                        #12

                        DavidCrow wrote:

                        It was that he talked about modal while linking to a modeless article.

                        Ah, he's taking the zen approach to computer programming. Learn X, by learning about ~X. Iain.

                        Iain Clarke appears because CPallini still cares.

                        D 1 Reply Last reply
                        0
                        • I Iain Clarke Warrior Programmer

                          DavidCrow wrote:

                          It was that he talked about modal while linking to a modeless article.

                          Ah, he's taking the zen approach to computer programming. Learn X, by learning about ~X. Iain.

                          Iain Clarke appears because CPallini still cares.

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

                          That reminds me of an incident in the elevator yesterday. The elevators in the lobby of our building can go up (to floors 2-15), or down (to floors B and SB). Above the elevator doors are red arrows pointing down. They are lit when the elevator is going down (and unlit otherwise) to let those getting on know where they are headed to. I got on yesterday with a guy that was apparently new to the building. We were both going up. Because I had gotten on so quickly, he asked me how I knew that the elevator was indeed going up. I told him it was because the red arrows did not tell me it was going down. Sort of a reverse logic thing.

                          "Love people and use things, not love things and use people." - Unknown

                          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                          I 1 Reply Last reply
                          0
                          • D David Crow

                            That reminds me of an incident in the elevator yesterday. The elevators in the lobby of our building can go up (to floors 2-15), or down (to floors B and SB). Above the elevator doors are red arrows pointing down. They are lit when the elevator is going down (and unlit otherwise) to let those getting on know where they are headed to. I got on yesterday with a guy that was apparently new to the building. We were both going up. Because I had gotten on so quickly, he asked me how I knew that the elevator was indeed going up. I told him it was because the red arrows did not tell me it was going down. Sort of a reverse logic thing.

                            "Love people and use things, not love things and use people." - Unknown

                            "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                            I Offline
                            I Offline
                            Iain Clarke Warrior Programmer
                            wrote on last edited by
                            #14

                            You are going to be in trouble when the bulb breaks! Iain.

                            Iain Clarke appears because CPallini still cares.

                            D 1 Reply Last reply
                            0
                            • I Iain Clarke Warrior Programmer

                              You are going to be in trouble when the bulb breaks! Iain.

                              Iain Clarke appears because CPallini still cares.

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

                              Iain Clarke wrote:

                              You are going to be in trouble when the bulb breaks!

                              :laugh: They are already somewhat unreliable (built in the 50s). Worst case, and has happened, I go to the 7th floor via the sub-basement.

                              "Love people and use things, not love things and use people." - Unknown

                              "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                              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