Problem with same property page in multiple property sheets 
Author Message
 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);



Sat, 29 May 2004 03:01:10 GMT  
 Problem with same property page in multiple property sheets
You have to create multiple instances of the property page; you can't do it with a single
instance. It makes no sense to share a single instance of a property page across multiple
property sheets.
                        joe


Quote:
>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);

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Sat, 29 May 2004 04:43:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problems with property sheets and property pages

2. Property Sheet and Property pages in ATL

3. How to disable property page on property sheet.

4. Property sheet in a property page

5. Property pages disappearing from property sheet on selection

6. questions regarding property sheet and property page

7. Sizing Property Sheets/Property Pages

8. Property Sheet and Property Pages

9. Property Sheet on Property Page?

10. resizable property sheet and property page

11. Q: Set Tab Window Text in Property Page/Property Sheet

12. Property Sheets and property pages!!

 

 
Powered by phpBB® Forum Software