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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. -- Tomasz Sowinski -- (or anyone)

-- Tomasz Sowinski -- (or anyone)

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 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.
  • R Offline
    R Offline
    Rickard Andersson20
    wrote on last edited by
    #1

    It's about the "change one thing in an other dialog" stuff! :) Let us say I create a new app with AppWizard. I put a button on that dialog (Dialog 1). When I push that button a second dialog (Dialog 2) appears that has WS_POPUP style. Then I put a button on that dialog too. When I push that button I want to for eg. change the caption on the button that is on Dialog 1, HOW?? I tried this: CDialogOneDlg dlg; dlg.btn.SetWindowText("TEST"); // dlg = 'Dialog 1', btn = a CButton on Dialog 1 But the compiler says there is no window??hmmm... The dialog is already created so why this error message?? :confused: :confused: ------------------------------ CodeCracker - That's me! :) ------------------------------

    F R 2 Replies Last reply
    0
    • R Rickard Andersson20

      It's about the "change one thing in an other dialog" stuff! :) Let us say I create a new app with AppWizard. I put a button on that dialog (Dialog 1). When I push that button a second dialog (Dialog 2) appears that has WS_POPUP style. Then I put a button on that dialog too. When I push that button I want to for eg. change the caption on the button that is on Dialog 1, HOW?? I tried this: CDialogOneDlg dlg; dlg.btn.SetWindowText("TEST"); // dlg = 'Dialog 1', btn = a CButton on Dialog 1 But the compiler says there is no window??hmmm... The dialog is already created so why this error message?? :confused: :confused: ------------------------------ CodeCracker - That's me! :) ------------------------------

      F Offline
      F Offline
      Fazlul Kabir
      wrote on last edited by
      #2

      But the compiler says there is no window??hmmm... The dialog is already created so why this error message?? It's true that the C++ object of the dialog is created but not the window. The window will be created when you call something like dlg.DoModal(); As for the 2 dialog issue, you can save the pointers of the first dialog in the 2nd one and thus once the 2nd on is displayed, you have the access to all of the controls in the first one. // Fazlul


      Get RadVC today! Play RAD in VC++ http://www.capitolsoft.com

      1 Reply Last reply
      0
      • R Rickard Andersson20

        It's about the "change one thing in an other dialog" stuff! :) Let us say I create a new app with AppWizard. I put a button on that dialog (Dialog 1). When I push that button a second dialog (Dialog 2) appears that has WS_POPUP style. Then I put a button on that dialog too. When I push that button I want to for eg. change the caption on the button that is on Dialog 1, HOW?? I tried this: CDialogOneDlg dlg; dlg.btn.SetWindowText("TEST"); // dlg = 'Dialog 1', btn = a CButton on Dialog 1 But the compiler says there is no window??hmmm... The dialog is already created so why this error message?? :confused: :confused: ------------------------------ CodeCracker - That's me! :) ------------------------------

        R Offline
        R Offline
        Remi Morin
        wrote on last edited by
        #3

        CDialogOneDlg dlg;
        dlg.btn.SetWindowText("TEST");

        there you create a new CDialogOneDlg. You must get a pointer to you'r previous CDialogOneDlg, (CDialogOneDlg* dlg) and for this you will have to do something like

        CDialogOneDlg* p_dlg;
        p_dlg = (CDialogOneDlg*)this->GetParent();
        p_dlg->btn.SetWindowText("TEST");

        Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com

        R 1 Reply Last reply
        0
        • R Remi Morin

          CDialogOneDlg dlg;
          dlg.btn.SetWindowText("TEST");

          there you create a new CDialogOneDlg. You must get a pointer to you'r previous CDialogOneDlg, (CDialogOneDlg* dlg) and for this you will have to do something like

          CDialogOneDlg* p_dlg;
          p_dlg = (CDialogOneDlg*)this->GetParent();
          p_dlg->btn.SetWindowText("TEST");

          Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com

          R Offline
          R Offline
          Rickard Andersson20
          wrote on last edited by
          #4

          THANK YOU SO FUCKING MEGA BIG MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! YOU SHOULD BE THE NEXT KING!!!!!!!!!! DAMN THANK YOU!!!!!! :):):):):):):):):):):):):):):):rose: :rose: :rose: ------------------------------ CodeCracker - That's me! :) ------------------------------

          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