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. Interaction between dialog boxes

Interaction between dialog boxes

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

    Hi!! I am working on an SDI MFC application. I have two dialog boxes. I want to pass some File name from one dialog box to another on clicking OK command button. The file name has to be displayed on the text box of second dialog, when the second dialog appears on the screen . Can any body tell me , how to declare variables and wat functions to use. I am new to MFC. Thanx

    I 1 Reply Last reply
    0
    • S swaapu

      Hi!! I am working on an SDI MFC application. I have two dialog boxes. I want to pass some File name from one dialog box to another on clicking OK command button. The file name has to be displayed on the text box of second dialog, when the second dialog appears on the screen . Can any body tell me , how to declare variables and wat functions to use. I am new to MFC. Thanx

      I Offline
      I Offline
      Intertherain
      wrote on last edited by
      #2

      there are two methods (1)use CWnd::SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 ); (2)you can add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second Dialog access it. libo

      S 1 Reply Last reply
      0
      • I Intertherain

        there are two methods (1)use CWnd::SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 ); (2)you can add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second Dialog access it. libo

        S Offline
        S Offline
        swaapu
        wrote on last edited by
        #3

        Hi! Thanx for giving responses to my problem. You had told me: "add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second Dialog access it." But, please tell me , that ,"how to pass the file name of the first dialog to the variable..." Can u tell me some code as I am new to mfc programming Thanx a lot for ur valuable time

        Mircea PuiuM 1 Reply Last reply
        0
        • S swaapu

          Hi! Thanx for giving responses to my problem. You had told me: "add a variable in the CMainFrm. pass the File name of the first Dialog to the variable.then the second Dialog access it." But, please tell me , that ,"how to pass the file name of the first dialog to the variable..." Can u tell me some code as I am new to mfc programming Thanx a lot for ur valuable time

          Mircea PuiuM Offline
          Mircea PuiuM Offline
          Mircea Puiu
          wrote on last edited by
          #4

          You have probably two classes derived from CDialog for your dialogs. Let them be (it's just an example) CYourDlg1 and CYourDlg2. I guess you are using them like that (supossing they are modal):

          CYourDlg1 dlg1;
          .
          .
          dlg1.DoModal()

          and

          CYourDlg2 dlg2;
          .
          .
          dlg2.DoModal()

          respectively. Now, let's say you want to pass some CString data (containing a fully qualified name of some file), which you get from dlg1, to dlg2. You must add some data member to each of those two classes: CString m_strFile. In the OnOK() function of CYourDlg1 you add the line: m_strFile = ... with the dots replaced by something you are using there (:-)). Before calling dlg2.DoModal(), you initialize the data of dlg2 with data from dlg1: dlg2.m_strFile = dlg1.m_strFile SkyWalker -- modified at 3:13 Sunday 9th October, 2005

          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