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. Help! need some tutorials on dialogs in an NONE dialog based application

Help! need some tutorials on dialogs in an NONE dialog based application

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialhelp
3 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.
  • I Offline
    I Offline
    Ibana
    wrote on last edited by
    #1

    Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter

    S M 2 Replies Last reply
    0
    • I Ibana

      Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter

      S Offline
      S Offline
      shiraztk
      wrote on last edited by
      #2

      Hi I understand your problem is to accept user input through a dialog and get those data in the View class of a SDI/MDI, is that so ? Then you could try doing this, Insert a Dialog into the project. Add the control you want on the dialog. Now add a class CUserDlg for the dialog, deriving it from CDailog. Add member functions like GetName, GetAge, GetGender etc to the CUserDlg, these should return the data that you want to pass to the view class. Now create a memberf m_dlgUserData of type CUserDlg in the View Class. Call DoModal to display the Dialog and when finished (ie pressed ok) Call m_dlgUserData.GetAge(), to get the age of the user. This way you get the age of the user entered in the dialog into the View Class. Hope I answered your question... Regards The Best Relligion is Science. Once you understand it, you will know God.

      1 Reply Last reply
      0
      • I Ibana

        Hi there, I have tried to get a dialog to transfer data from a combobox into the view class member but I havent been able to get it to work get crashes. All I want is a tutorial on how to change som variables in a dialog that effects the members of the view class. This must be a ordinary thing that must want to achive. Every windows program has dialogs to set alot of options etc. Hope you got something for me!.) regards Peter

        M Offline
        M Offline
        Michael P Butler
        wrote on last edited by
        #3

        The simplest way of transfering data between dialogs and views. Is to pass a pointer to the view class into the dialog class either via the constructor or via a method that is called before DoModal. In the constructor, assign the view pointer to a class member variable and then you can call view methods in any of your dialog methods. Michael CP Blog [^]

        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