
Problem with same property page in multiple property sheets
My view class has multiple property sheets that are displayed one at a
time depending on user actions. There is a common property page that
is used in every sheet. I seem to be running into a problem when I
create one instance of this property page and add it to multiple
sheets. The code compiles fine but when I run my program and click on
the tab for the page that was assigned to multiple sheets the tab
either disappears or I get an unhandled exception error.
Is there a work around for this problem, or will I have to create
separate instances of the common dialog for each property sheet it is
added to?
Here is sample code to illustrate:
propPage1 = new CpropPage1();
propPage2 = new CpropPage2();
propPage3 = new CpropPage3();
propsheet1 = new CPropertySheet("", this, 0);
propsheet2 = new CPropertySheet("", this, 0);
propsheet1->AddPage(propPage1);
propsheet1->AddPage(propPage2);
//when propPage2 is clicked on propSheet1 there will
//be an unhandledexception error when you click
//ignore on the debug assertion error.
propsheet1->Create(this, WS_CHILD);
propsheet2->AddPage(propPage3);
propsheet2->AddPage(propPage2);
//this propPage2 displays just fine on propSheet2
propsheetPIR->Create(this, WS_CHILD);