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. PropertyPage help instantiating

PropertyPage help instantiating

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
3 Posts 2 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.
  • K Offline
    K Offline
    KingTermite
    wrote on last edited by
    #1

    Ok....forgive my ignorance...I'm a relative newbie in VC++....I've done a little, but that's about it. I have a dialog/propertysheet that has 3 tabs (propertypages). When it comes up it is on the first tab. If I click on the third tab, I get an error during one operation because its trying to access a control within the 2nd tab's window and apprently it doesn't instantiate until clicked on. If I click on the 2nd tab first, then run that operation, it works like a champ. But if not, the pointer to that propertypage is still null. How can I instantiate that propetypage when the program starts up, regardless of whether it was clicked or not. If there's a way, I may as well instantiate all proppages at once. Any suggestions are appreciated.

    M 1 Reply Last reply
    0
    • K KingTermite

      Ok....forgive my ignorance...I'm a relative newbie in VC++....I've done a little, but that's about it. I have a dialog/propertysheet that has 3 tabs (propertypages). When it comes up it is on the first tab. If I click on the third tab, I get an error during one operation because its trying to access a control within the 2nd tab's window and apprently it doesn't instantiate until clicked on. If I click on the 2nd tab first, then run that operation, it works like a champ. But if not, the pointer to that propertypage is still null. How can I instantiate that propetypage when the program starts up, regardless of whether it was clicked or not. If there's a way, I may as well instantiate all proppages at once. Any suggestions are appreciated.

      M Offline
      M Offline
      Mike Danberg
      wrote on last edited by
      #2

      If you are setting the property sheet up correctly then they should all load with no problems at all. If you are just clicking on the tab itself and you're running into problems, then something is wrong with the way you added pages to the property sheet. Maybe if you posted a code snippet of when you instatiate the property sheet, it would help. As far as the problem with the third tab error, you can't access a control on the other tab. It's exactly the same as having a dialog that's not open yet. The control isn't there, so you can't access it. Hope that helps. Can't really tell you much more since I don't know exactly what you're doing.

      K 1 Reply Last reply
      0
      • M Mike Danberg

        If you are setting the property sheet up correctly then they should all load with no problems at all. If you are just clicking on the tab itself and you're running into problems, then something is wrong with the way you added pages to the property sheet. Maybe if you posted a code snippet of when you instatiate the property sheet, it would help. As far as the problem with the third tab error, you can't access a control on the other tab. It's exactly the same as having a dialog that's not open yet. The control isn't there, so you can't access it. Hope that helps. Can't really tell you much more since I don't know exactly what you're doing.

        K Offline
        K Offline
        KingTermite
        wrote on last edited by
        #3

        Mike Danberg wrote: As far as the problem with the third tab error, you can't access a control on the other tab. It's exactly the same as having a dialog that's not open yet. The control isn't there, so you can't access it. Hope that helps. Can't really tell you much more since I don't know exactly what you're doing. Well....I was trying to find a way to make sure the dialog "was there" so I could access the control. Here's more on the problem (fixed now btw) just for information...I couldn't post a code snippet as it is a work project (IP and all that crapola ya know). It is a power pnael interface for a test station and one tab is a "health monitor" and the two other are two seperate "power" panels for powering up power supplies. The health monitor needs to inactivate monitor controls for power supplies that are not powered. the logic was there for them to safely not run, but I wanted to make the controls visibly disabled to show that they weren't evens selectable while power supplies were not powered up (checkboxes). However, OnSetActivate() was just the trick I needed (and didn't know). I overrode that function and now when that tab is pressed (instead of during the other tab's processing), I can deactivate the controls. Thanks. :)


        There are only 10 types of people in this world....those that understand binary, and those that do not.

        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