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. CPropertySheet & CPropertyPage

CPropertySheet & CPropertyPage

Scheduled Pinned Locked Moved C / C++ / MFC
questiondebuggingannouncement
5 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.
  • L Offline
    L Offline
    ladder
    wrote on last edited by
    #1

    1. In MSDN, the disactive Page not initialize if you not click it, how can I initialize all page when the sheet is shown? 2. When I use the function "UpdateDialogControls" in a CPropertyPage, in Debug mode, it works perfectly, but in release mode, some warning will be shown, and the applications will destory, why?

    O 1 Reply Last reply
    0
    • L ladder

      1. In MSDN, the disactive Page not initialize if you not click it, how can I initialize all page when the sheet is shown? 2. When I use the function "UpdateDialogControls" in a CPropertyPage, in Debug mode, it works perfectly, but in release mode, some warning will be shown, and the applications will destory, why?

      O Offline
      O Offline
      olinn
      wrote on last edited by
      #2

      about 1: i don't understand your problem, Isn't all we need to addpage before creating the propertysheet? Then all the page you add will be shown.

      L 1 Reply Last reply
      0
      • O olinn

        about 1: i don't understand your problem, Isn't all we need to addpage before creating the propertysheet? Then all the page you add will be shown.

        L Offline
        L Offline
        ladder
        wrote on last edited by
        #3

        In MSDN, the Method "AddPage"'s describe, MS told us "AddPage adds the CPropertyPage object to the CPropertySheet object’s list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.", so if I don't click the page, the page's member can not be accessed or make a exception. But if I click the page, the "OnInitDialog" will be executed, so I can access the page's member when the sheet destory. so I need initialze the all pages when the sheet be shown, the all pages's "OnInitDialog" will be executed.

        J 1 Reply Last reply
        0
        • L ladder

          In MSDN, the Method "AddPage"'s describe, MS told us "AddPage adds the CPropertyPage object to the CPropertySheet object’s list of pages but does not actually create the window for the page. The framework postpones creation of the window for the page until the user selects that page.", so if I don't click the page, the page's member can not be accessed or make a exception. But if I click the page, the "OnInitDialog" will be executed, so I can access the page's member when the sheet destory. so I need initialze the all pages when the sheet be shown, the all pages's "OnInitDialog" will be executed.

          J Offline
          J Offline
          Joan M
          wrote on last edited by
          #4

          During the constructor, modify the m_psp struct of the newly added property page in this way: this->m_YourPropertyPageDlg.m_psp.dwFlags |= PSP_PREMATURE; hope this helps.

          https://www.robotecnik.com freelance robots, PLC and CNC programmer.

          L 1 Reply Last reply
          0
          • J Joan M

            During the constructor, modify the m_psp struct of the newly added property page in this way: this->m_YourPropertyPageDlg.m_psp.dwFlags |= PSP_PREMATURE; hope this helps.

            L Offline
            L Offline
            ladder
            wrote on last edited by
            #5

            Perfectly, Thanks.

            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