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. access data in dialog from win32 application

access data in dialog from win32 application

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++designtutorialquestion
2 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.
  • A Offline
    A Offline
    asdeshmukh
    wrote on last edited by
    #1

    Hi, This question is related to win32 user interface programming. I need to use Single threaded runtime library and cannot use MFC. Thus I am using win32. I have designed a dialog that should take three float values as input. How do write the code to do data exchange so that values entered by the user are available to me in some local variable after the user has clicked "OK" on the dialog after entering some values. I can do this in MFC and but do not know how to do this using win32. I could create file open dialog using GetOpenFileName but did not find any similar function for writing data exchange code. Any help would be great as I am stuck and want to get this done asap. :) Thanks in advance for your help. Regards, Abhijit

    T 1 Reply Last reply
    0
    • A asdeshmukh

      Hi, This question is related to win32 user interface programming. I need to use Single threaded runtime library and cannot use MFC. Thus I am using win32. I have designed a dialog that should take three float values as input. How do write the code to do data exchange so that values entered by the user are available to me in some local variable after the user has clicked "OK" on the dialog after entering some values. I can do this in MFC and but do not know how to do this using win32. I could create file open dialog using GetOpenFileName but did not find any similar function for writing data exchange code. Any help would be great as I am stuck and want to get this done asap. :) Thanks in advance for your help. Regards, Abhijit

      T Offline
      T Offline
      Tom Archer
      wrote on last edited by
      #2

      Use GetDlgItem to get the hwnd of the control (hWnd is your dialog's hwnd, nIDC is your control's resource id)

      HWND hWndCtrl;
      ::GetDlgItem(hWnd, nIDC, &hWndCtrl);

      Use GetWindowText to then get the control's value:

      TCHAR szT[64];
      ::GetWindowText(hWndCtrl, szT, _countof(szT));

      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