Adding dynamic pages to wizard 97 style sheet 
Author Message
 Adding dynamic pages to wizard 97 style sheet

Hello,

I have a CPropertySheet that I am displaying using the wizard 97 styles
(in wizard mode).  I initially add 3 pages to the sheet.  I display the
wizard using DoModal().  Then in the OnWizardNext of the third property
sheet, I dynamically add additional pages to the wizard (using
CPropertySheet::AddPage).  This causes access violations in the
CPropertySheet::AddPage code, and the next page does not display
properly.  After this point the wizard is in bad shape.  Is it possible
to add pages dynamically to a wizard that is already being displayed?

Thanks for any help.

Pavan



Fri, 05 Jul 2002 03:00:00 GMT  
 Adding dynamic pages to wizard 97 style sheet
The help topic says "If you call AddPage after displaying the property page, the
tab row will reflect the newly added page". So, theoretically, you should be
able to do what you are trying to do.
Please share the relevant snippet of your code, maybe we can see the problem
there.


Fri, 05 Jul 2002 03:00:00 GMT  
 Adding dynamic pages to wizard 97 style sheet
Yeah, the documentation implies that it should work, and I had similar code that
worked with a wizard that was not using the wizard 97 style.  However with the
wizard 97 style, it does not work.

I have the following property pages (all derived from CPropertyPageEx):

CWpgIntro
CWpgMiddle
CWpgFinish

In the constructor of my CPropertySheetEx derived class, I add the first two pages
using AddPage.  Then after calling DoModal, in the OnWizardNext of CWpgMiddle,  I
have the following code:

CPropertyPageEx::OnWizardNext();
CWshParent * pWsh = static_cast<CWshParent *>( GetParent() );
pWsh->AddPage( new CWpgFinish() );
return 0;

The next page (CWpgFinish) does not display correctly (the header information is not
present).  And cancelling the wizard at this point causes exceptions to be thrown.
If I add all three pages initially in the constructor, the wizard works fine.  But
despite the documentation, if I add the third page after the wizard is displayed, it
doesn't work.

Help is appreciated.

Thanks

Pavan

Quote:

> The help topic says "If you call AddPage after displaying the property page, the
> tab row will reflect the newly added page". So, theoretically, you should be
> able to do what you are trying to do.
> Please share the relevant snippet of your code, maybe we can see the problem
> there.



Sat, 06 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Wizard 97 style of wizards?

2. Dynamic style sheet with .NET

3. Property Sheet (wizard)- Next goes to previous page

4. Creating Property Sheets and Property Pages w/o the Class Wizard

5. Dynamic update of wizard pages

6. Wizard 97 Bug?

7. Property Pages & Add new hardware wizard

8. Property pages w/ add new hardware wizard

9. Adding page to property sheet (vc60)

10. Property Page added to Sheet Dynamically cause assertion

11. Property sheet - adding and removing pages problem.

12. Office 97 style with VC++ 5???

 

 
Powered by phpBB® Forum Software