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 quirk

CPropertySheet CPropertyPage quirk

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    I am trying to build a property sheet with its pages instantiated in the header file of the sheet. The project builds fine, but gives an assertion error on ASSERT(afxCurrentResourceHandle != NULL) as soon as execution is attempted (in the construction of a page). This error does not occur if pages are instatiated "on-the-fly" in the body of the property sheet previous to the DoModal() call. But I need to have property page member functions visible to other classes, so they need to be predefined. Any ideas as to why it barfs on property page construction in this setting? Thanks in advance, Ben

    V 1 Reply Last reply
    0
    • A Anonymous

      I am trying to build a property sheet with its pages instantiated in the header file of the sheet. The project builds fine, but gives an assertion error on ASSERT(afxCurrentResourceHandle != NULL) as soon as execution is attempted (in the construction of a page). This error does not occur if pages are instatiated "on-the-fly" in the body of the property sheet previous to the DoModal() call. But I need to have property page member functions visible to other classes, so they need to be predefined. Any ideas as to why it barfs on property page construction in this setting? Thanks in advance, Ben

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      Post the code in the sheet's constructor and the code that adds the pages. Kuphryn

      B 2 Replies Last reply
      0
      • V valikac

        Post the code in the sheet's constructor and the code that adds the pages. Kuphryn

        B Offline
        B Offline
        Ben805
        wrote on last edited by
        #3

        Constructor: CMsgETIData::CMsgETIData() : CPropertyPage(CMsgETIData::IDD) { //{{AFX_DATA_INIT(CMsgETIData) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } How I _was_ adding pages: CMsgETIData m_page2; m_DQRMsgCreateSheet.AddPage(&m_page2); m_DQRMsgCreateSheet.DoModal(); m_DQRMsgCreateSheet.RemovePage(&m_page2); How I _want_ to add pages: in the sheet header: public: CMsgETIData m_page2; in the body: m_DQRMsgCreateSheet.AddPage(&m_page2); m_DQRMsgCreateSheet.DoModal();

        1 Reply Last reply
        0
        • V valikac

          Post the code in the sheet's constructor and the code that adds the pages. Kuphryn

          B Offline
          B Offline
          Ben805
          wrote on last edited by
          #4

          Sorry...actually I want to do AddPage(&m_page2) in the constructor of the sheet!

          V 1 Reply Last reply
          0
          • B Ben805

            Sorry...actually I want to do AddPage(&m_page2) in the constructor of the sheet!

            V Offline
            V Offline
            valikac
            wrote on last edited by
            #5

            Correct. The call to AddPage() should work correct in the constructor. Kuphryn

            B 1 Reply Last reply
            0
            • V valikac

              Correct. The call to AddPage() should work correct in the constructor. Kuphryn

              B Offline
              B Offline
              Ben805
              wrote on last edited by
              #6

              Correct. The call to AddPage() should work correct in the constructor. Should is the key word...that is the problem!

              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