关于VC的CPropertySheet的问题

来源:百度知道 编辑:UC知道 时间:2024/06/13 16:25:36
我在资源的Dialog中新建了2个CPropertyPage的资源,并为每个继承了这个类,写了CProp1和CProp2。然后,我继承了CPropertySheet,写了CPropSheet,并用AddPage增加了m_prop1,m_prop2,然后改成向导的类型。在OnSetActive()中,要用SetWizardButton()这个函数,如((CPropertySheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
我的问题是:((CPropSheet*)GetParent())->SetWizardButtons(PSWIZB_NEXT | PSWIZB_BACK);
我觉得现在是用在CPropSheet,应该用:((CPropSheet*)GetParent()),请高手指点,谢谢!
看不太懂,我是初学者

CPropertySheet *parent = (CPropertySheet*)GetParent();
parent->SetWizardButtons(PSWIZB_FINISH|PSWIZB_BACK);

曾经我是这么写的

访问page的protect或者public变量或方法等
((CStudentInfWizard*)parent)->m_ScoreRegisterPage.m_nPreScore[4])
m_ScoreRegisterPage为一个page在wizard的对象,m_nPreScore[4]为一个protect变量