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 get IDD of a PropertyPage dialog? [modified]

How to get IDD of a PropertyPage dialog? [modified]

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

    Hello, I have a property sheet that I want to check whether a specific page is Active or not. How can I get IDD of associated dialog resource in a property page I tried following code but GetDlgCtrlID() fails (returns 0). By the way I don't think it is important but anyway the property sheet is embedded in a CFormView //in CMyView int nID = pDoc->m_sheetProperty.GetActivePage()->GetDlgCtrlID(); if(nID == IDD_INTERESTING)//nID is always zero even when IDD_INTERESTING is active { ... } thanks:)

    D 1 Reply Last reply
    0
    • E Electronic75

      Hello, I have a property sheet that I want to check whether a specific page is Active or not. How can I get IDD of associated dialog resource in a property page I tried following code but GetDlgCtrlID() fails (returns 0). By the way I don't think it is important but anyway the property sheet is embedded in a CFormView //in CMyView int nID = pDoc->m_sheetProperty.GetActivePage()->GetDlgCtrlID(); if(nID == IDD_INTERESTING)//nID is always zero even when IDD_INTERESTING is active { ... } thanks:)

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

      Why does your CPropertySheet object belong to the document class rather than the view class?

      Electronic75 wrote:

      )//nID is always zero

      As it probably should be. GetDlgCtrlID() is for returning the ID of controls on dialog boxes or property pages. I've never known it necessary to query a dialog box's ID. In any case, I'd be more inclined to compare the return value of GetActivePage() with the class objects associated with the various pages. For example:

      CPropertyPage *p = pDoc->m_sheetProperty.GetActivePage();
      if (p->IsKindOf(RUNTIME_CLASS(CMyOtherPage)))
      ...
      else if (p->IsKindOf(RUNTIME_CLASS(CTheLastPage)))
      ...


      "A good athlete is the result of a good and worthy opponent." - David Crow

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      E 1 Reply Last reply
      0
      • D David Crow

        Why does your CPropertySheet object belong to the document class rather than the view class?

        Electronic75 wrote:

        )//nID is always zero

        As it probably should be. GetDlgCtrlID() is for returning the ID of controls on dialog boxes or property pages. I've never known it necessary to query a dialog box's ID. In any case, I'd be more inclined to compare the return value of GetActivePage() with the class objects associated with the various pages. For example:

        CPropertyPage *p = pDoc->m_sheetProperty.GetActivePage();
        if (p->IsKindOf(RUNTIME_CLASS(CMyOtherPage)))
        ...
        else if (p->IsKindOf(RUNTIME_CLASS(CTheLastPage)))
        ...


        "A good athlete is the result of a good and worthy opponent." - David Crow

        "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

        E Offline
        E Offline
        Electronic75
        wrote on last edited by
        #3

        Hi David, Well it is a MDI application that I did bizarre things to make it look nicer. eg. it has a property page embedded in a CFormView and even another CDocTemplate(Doc, View, Frame) embedded in one of the pages. It maybe bizarre but it looks good!:)

        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