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. My own Dialog Window and its edit boxes

My own Dialog Window and its edit boxes

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
3 Posts 2 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
    satcat
    wrote on last edited by
    #1

    Hi! I've built a dialog window in Visual C++ 6 with some edit boxes and buttons and I'd want these edit boxes to show some default texts. In main window I call this dialog window just clicking a button and I know I can get the information written in these edit boxes here in main code, but I don't know how could I show something in them when I click the button in main window, before than I could write anything myself. I think I have to use UpdateData but I haven't OnInitDialog() as in main code so I don't know where should I write it. In my own dialog window I only have some code that works when I click a button there. Any idea? Thank you in advance!

    L 1 Reply Last reply
    0
    • S satcat

      Hi! I've built a dialog window in Visual C++ 6 with some edit boxes and buttons and I'd want these edit boxes to show some default texts. In main window I call this dialog window just clicking a button and I know I can get the information written in these edit boxes here in main code, but I don't know how could I show something in them when I click the button in main window, before than I could write anything myself. I think I have to use UpdateData but I haven't OnInitDialog() as in main code so I don't know where should I write it. In my own dialog window I only have some code that works when I click a button there. Any idea? Thank you in advance!

      L Offline
      L Offline
      l a u r e n
      wrote on last edited by
      #2

      map some dialog class member variables to the edit controls in ur dialog box ... in ur main code that shows the dialog box do something like this: CMyDialog myDialog; myDialog.myVar1 = "hello world"; myDialog.myVar2 = "hello world again"; myDialog.DoModal(); etc etc


      "there is no spoon"
      biz stuff   about me

      S 1 Reply Last reply
      0
      • L l a u r e n

        map some dialog class member variables to the edit controls in ur dialog box ... in ur main code that shows the dialog box do something like this: CMyDialog myDialog; myDialog.myVar1 = "hello world"; myDialog.myVar2 = "hello world again"; myDialog.DoModal(); etc etc


        "there is no spoon"
        biz stuff   about me

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

        Yeah! It works now, thank you :)

        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