Mixing COM and non-COM property pages
-
I'm working on an object that crosses two systems (one system uses standard CPropertyPages for all its objects, the other uses COM/ATL IPropertyPageImpl) The standard system objects simply create a property sheet and invoke DoModal() while the other uses OleCreatePropertyFrame() for its pages. How do you launch a mixed collection of both systems? (CPropertyPages with COM/ATL ones) Thanks in advance for advice!
-
I'm working on an object that crosses two systems (one system uses standard CPropertyPages for all its objects, the other uses COM/ATL IPropertyPageImpl) The standard system objects simply create a property sheet and invoke DoModal() while the other uses OleCreatePropertyFrame() for its pages. How do you launch a mixed collection of both systems? (CPropertyPages with COM/ATL ones) Thanks in advance for advice!
DolphLundgren wrote: How do you launch a mixed collection of both systems? (CPropertyPages with COM/ATL ones) I don't know exactly how CPropertyPages work, so maybe what I'm about to suggest is just not doable. If so, then I appologize. I suppose you could inherit a new class from CPropertyPage, in which you host the COM property page, and mediates between the COM interfaces (IPropertyPage and IPropertyPageSite) and the CPropertyPage interface. What you need to think about when creating the COM property page is: * Your class based on CPropertyPage must implement IPropertyPageSite * After you've created the IPropertyPage object, call SetPageSite(this) * Give the COM object to the prop page object by using SetObjects() * Then call Activate(m_hWnd, rcTheRectangle, FALSE) * Followed by Show(SW_SHOW) (I think this is necessary - I don't remember - you'll notice) IPropertyPageSite is straightforward to implement. Please refer to the MSDN docs. Call the prop page object's Apply() method when suitable (probably on some well defined OnApply()-event defined for CPropertyPage). When you are closing down the CPropertyPage window, call the prop page object's Deactivate() method. -- Keep talking! You're the fool, I'm the preacher.