void CVSPropertySheet::Init()
{
CMainFrame *pMF = (CMainFrame *)::AfxGetMainWnd();
CVSSharkDoc *pDoc = (CVSSharkDoc *)pMF->GetActiveDocument();
if( pMF->m_bOpenWizard )
this->AddPage(&this->m_Page03OpenProject);
else
this->AddPage(&this->m_Page03NewProject);
this->AddPage(&this->m_Page05PartManage);
this->AddPage(&this->m_Page04MaterialManage);
this->AddPage(&this->m_Page06MaterialInfo);
this->AddPage(&this->m_Page07VS);
this->AddPage(&this->m_Page08PlateOptimize);
if( pDoc->m_bSurplusCurr )
{
this->AddPage(&this->m_Page10Surplus);
this->AddPage(&this->m_Page09AddCurrencyPart);
//this->AddPage(&this->m_Page07VS);//直接使用就创建不成功
}
else
{
this->AddPage(&this->m_Page09AddCurrencyPart);
//this->AddPagethis->m_Page07VS)(&;
this->AddPage(&this->m_Page10Surplus);
}

this->AddPage(&this->m_Page11CutOptimize); this->SetWizardMode();
if( pMF->m_bOpenWizard )
this->SetActivePage(&this->m_Page03OpenProject);
else
this->SetActivePage(&this->m_Page03NewProject);
}

解决方案 »

  1.   

    晕,如果有属性页 CPage1,CPage2如何在向导中放3页,如第1页是CPage1,第2页是CPage2,第3页还是CPage1;this 是CPropertySheet指针this->AddPage(&this->m_Page1); //第1次加
    this->AddPage(&this->m_Page2);
    this->AddPage(&this->m_Page1); //第2次加,如果没有这句,正常,加了之后就初始化对话框(属性页)失败如何在1个向导中,添加2个相同的属性页?
      

  2.   

    CPage1 *m_Page3 = new CPage1;
    this-  >AddPage(&this-  >m_Page3);
      

  3.   

    CPage1 *m_Page3 = new CPage1;
    this->AddPage(m_Page3);