How to get IDD of a PropertyPage dialog? [modified]
-
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:) -
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:)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 ofGetActivePage()
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
-
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 ofGetActivePage()
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
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!:)