#if !defined(AFX_CUSTOMCTRLVIEW_H__27733A44_3514_11D7_8B8F_0040333597D3__INCLUDED_) #define AFX_CUSTOMCTRLVIEW_H__27733A44_3514_11D7_8B8F_0040333597D3__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // CustomCtrlView.h : header file // ///////////////////////////////////////////////////////////////////////////// // CCustomCtrlView view /** * View for embedding any kind of control. * This is as opposed to CControlView which can only embed controls with no local data * (no data members, no virtual functions, see http://msdn.microsoft.com/msdnmag/issues/01/11/c/default.aspx). * @note Because of race conditions when creating the view and the custom control * we must test that the the custom control has been created in several message functions */ class CCustomCtrlView : public CView { CWnd* m_pCustomCtrl; protected: CCustomCtrlView(); // protected constructor used by dynamic creation DECLARE_DYNCREATE(CCustomCtrlView) // Attributes public: /** * Sets the given control as control for this view. * The control must already be child of this. */ void SetCustomCtrl(CWnd* pCustomCtrl) { ASSERT(m_pCustomCtrl == NULL); m_pCustomCtrl = pCustomCtrl; } CWnd* GetCustomCtrl() { return m_pCustomCtrl; } // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CCustomCtrlView) public: virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo); protected: virtual void OnDraw(CDC* pDC); // overridden to draw this view //}}AFX_VIRTUAL // Implementation protected: virtual ~CCustomCtrlView(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif // Generated message map functions protected: //{{AFX_MSG(CCustomCtrlView) afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_CUSTOMCTRLVIEW_H__27733A44_3514_11D7_8B8F_0040333597D3__INCLUDED_)