This has bugged me since I started using these handy little CWnd-derived windows. Even though you can create custom CPropertySheets and CPropertyPages to add to them, IMO MS screwed up bad with one part of the design.
There isn't a way to effectively cleanup the property pages that you add to the property sheet. You would think the property sheet keeps a list or vector of pages that have been added so it can clean them up later. However, this is not the case.
So I have to create a function inside of my derived property sheet class just for the purpose of adding pages to a list or vector. Then I call destroy when the main frame shuts down which then calls destroy for each of the pages, etc, etc.
Why did MS do it this way? Wouldn't it make sense to create a virtual destroy function inside of CPropertySheet so that derived classes could have a way of cleaning up the memory footprint?
MFC is awesome but could be much more. Some of it is so 'what was the designer thinking' oriented that it is quite limiting at times. A more open-ended approach would be much better for MFC. It has a lot of handy windows and classes, but many of them are so closely tied to how MS wants you to use them, that they really stifle creativity. MS needs to learn that not every application is going to use these classes for the exact purposes they intended and provide mechanisms by which to 'step outside the box'.
And no, .NET is not the answer I'm looking for. MFC is very good and encapsulates the API very well.