////////////////////////////////////////////////////////////////// // // PropPageHolder.h : header file // // CPropPageHolder manages the components IPropertyPage Interface // // It also exposes a IPropertyPageSite Interface for the // Component (not used for much though) // ////////////////////////////////////////////////////////////////// #if !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_) #define AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 ///////////////////////////////////////////////////////////////////////////// // CPropPageHolder command target class ATL_NO_VTABLE CPropPageHolder : public CComObjectRootEx, public IPropertyPageSite { // Attributes public: CPropPageHolder(); // CPropPageHolder(IPropertyPage* pPage, IUnknown* pSite); virtual ~CPropPageHolder(); // Operations public: HRESULT Close(); bool IsActivated(); // Is Proppage Created? HRESULT Apply(); // Save Changes to Data Object bool IsInitialized(); // Is Initialized? // Checks to see if it has a IPropPage HRESULT Initialize(IPropertyPage* pUnk, IUnknown* pSite); // Activates and Shows the Page // For best results start with WS_VISIBLE = false in // dialog template (no flicker) HRESULT Create(HWND hwndParent, const RECT& rect, bool bModalParent = true); // DeActivates Page and Releases IPropPage HRESULT Destroy(); // Window Functions HRESULT Show(UINT nCmdShow); HRESULT Move(const RECT& rect); // Implementation protected: HRESULT LoadInfo(); // Is Created or not? bool m_bActivated; IPropertyPage* m_pPropPage; PROPPAGEINFO m_PageInfo; IUnknown* m_pSite; // This is a pointer to the Page Container Site // Returned from IPropertyPageSite::GetPageContainer public: DWORD GetHelpContext(); string GetHelpFile(); string GetTitle(); DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CPropPageHolder) COM_INTERFACE_ENTRY(IPropertyPageSite) END_COM_MAP() // IPropertyBag STDMETHOD(OnStatusChange)(DWORD dwFlags); STDMETHOD(GetLocaleID)(LCID* pLocaleID); STDMETHOD(GetPageContainer)(IUnknown** ppUnk); STDMETHOD(TranslateAccelerator)(LPMSG pMsg); }; ///////////////////////////////////////////////////////////////////////////// #endif // !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_)