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. How to set values in CPageSetupDialog?

How to set values in CPageSetupDialog?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
8 Posts 4 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.
  • L Offline
    L Offline
    Le rner
    wrote on last edited by
    #1

    hi all, i want to set values to CPageSetupDialog,before open this dialog like: paper size,sorce,orientation and margin. how can i do this thanks. thanks.

    L C 2 Replies Last reply
    0
    • L Le rner

      hi all, i want to set values to CPageSetupDialog,before open this dialog like: paper size,sorce,orientation and margin. how can i do this thanks. thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use the m_psd member of the CPageSetupDialog[^].

      Use the best guess

      L 1 Reply Last reply
      0
      • L Lost User

        Use the m_psd member of the CPageSetupDialog[^].

        Use the best guess

        L Offline
        L Offline
        Le rner
        wrote on last edited by
        #3

        what field use to set source value?

        L 1 Reply Last reply
        0
        • L Le rner

          what field use to set source value?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I gave you a link to the documentation, you need to go and study it to decide which items you are interested in.

          Use the best guess

          1 Reply Last reply
          0
          • L Le rner

            hi all, i want to set values to CPageSetupDialog,before open this dialog like: paper size,sorce,orientation and margin. how can i do this thanks. thanks.

            C Offline
            C Offline
            Coder Block
            wrote on last edited by
            #5

            may be this help u... :) u may have dialog class like,

            CPageSetupDialog abc;
            //Conding to set values.
            abc.papersize = 10;
            abc.sorce = "ACC";
            abc.margin = 44;
            //ETC.
            //And then modal it..Like,
            if(abc.DoModal() == IKOK)
            {
            //Success;
            }else
            {
            //Fail..
            }

            L 1 Reply Last reply
            0
            • C Coder Block

              may be this help u... :) u may have dialog class like,

              CPageSetupDialog abc;
              //Conding to set values.
              abc.papersize = 10;
              abc.sorce = "ACC";
              abc.margin = 44;
              //ETC.
              //And then modal it..Like,
              if(abc.DoModal() == IKOK)
              {
              //Success;
              }else
              {
              //Fail..
              }

              L Offline
              L Offline
              Le rner
              wrote on last edited by
              #6

              Coder Block wrote:

              CPageSetupDialog abc; //Conding to set values. abc.papersize = 10; abc.sorce = "ACC"; abc.margin = 44; //ETC. //And then modal it..Like, if(abc.DoModal() == IKOK) { //Success; }else { //Fail.. }

              gives error

              error C2039: 'margin' : is not a member of 'CPageSetupDialog'
              error C2039: 'papersize' : is not a member of 'CPageSetupDialog'
              error C2039: 'sorce' : is not a member of 'CPageSetupDialog'

              D C 2 Replies Last reply
              0
              • L Le rner

                Coder Block wrote:

                CPageSetupDialog abc; //Conding to set values. abc.papersize = 10; abc.sorce = "ACC"; abc.margin = 44; //ETC. //And then modal it..Like, if(abc.DoModal() == IKOK) { //Success; }else { //Fail.. }

                gives error

                error C2039: 'margin' : is not a member of 'CPageSetupDialog'
                error C2039: 'papersize' : is not a member of 'CPageSetupDialog'
                error C2039: 'sorce' : is not a member of 'CPageSetupDialog'

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Read the docs, PLEASE!

                abc.m_psd.ptPaperSize = 10;
                abc.m_psd.rtMargin = 44;
                ...

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

                1 Reply Last reply
                0
                • L Le rner

                  Coder Block wrote:

                  CPageSetupDialog abc; //Conding to set values. abc.papersize = 10; abc.sorce = "ACC"; abc.margin = 44; //ETC. //And then modal it..Like, if(abc.DoModal() == IKOK) { //Success; }else { //Fail.. }

                  gives error

                  error C2039: 'margin' : is not a member of 'CPageSetupDialog'
                  error C2039: 'papersize' : is not a member of 'CPageSetupDialog'
                  error C2039: 'sorce' : is not a member of 'CPageSetupDialog'

                  C Offline
                  C Offline
                  Coder Block
                  wrote on last edited by
                  #8

                  As usual declare all this in .h file of CPageSetupDialog..

                  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