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. quick question

quick question

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
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.
  • Q Offline
    Q Offline
    Qbus
    wrote on last edited by
    #1

    what is the command for getting a pointer to the document class from a dialog class. Sorry if this is a basic question, but I don't seem to know how to get variables from the doc class from my document class Q-Bus

    T 1 Reply Last reply
    0
    • Q Qbus

      what is the command for getting a pointer to the document class from a dialog class. Sorry if this is a basic question, but I don't seem to know how to get variables from the doc class from my document class Q-Bus

      T Offline
      T Offline
      Terry ONolley
      wrote on last edited by
      #2

      Add a member variable for your dialog class to store the pointer to the document. After instantiating but before calling your dialog, assign the pointer for your document class to this new member variable.


      Have you answered an MTQ? Check out the stats!
      What's the latest butt-scratch count? Check it out!

      S 1 Reply Last reply
      0
      • T Terry ONolley

        Add a member variable for your dialog class to store the pointer to the document. After instantiating but before calling your dialog, assign the pointer for your document class to this new member variable.


        Have you answered an MTQ? Check out the stats!
        What's the latest butt-scratch count? Check it out!

        S Offline
        S Offline
        sam India
        wrote on last edited by
        #3

        Create the dialog box in Document class. if var1 and var2 are 2 variables of document class to be used by dialog class. if var3 and var4 are variables of dialog box class. CMyDoc::MyFunc() { CMyDialog Mydlg; Mydlg.var3 = var1; Mydlg.var4 = var2; if(Mydlg.DoModal()= IDOK) { var1 = Mydlg.var3; var2 = Mydlg.var4; } } never say die

        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