Dear Emmanuel,
Please do following steps:
1) Add template-adaptor class into your project (somewhere before your view class declaration):
template < class CExtAFVBase >
class CExtAFV : public CExtAFVBase
{
public:
CExtAFV()
{
}
CExtAFV( LPCTSTR lpszTemplateName, CWnd * pParentWnd )
: CExtAFVBase( lpszTemplateName )
{
pParentWnd;
}
CExtAFV( UINT nIDTemplate, CWnd * pParentWnd )
: CExtAFVBase( nIDTemplate )
{
pParentWnd;
}
};
2) Modify your view class declaration:
// class CTestView : public CFormView
class CTestView
: public CExtWA < CExtAFV < CFormView > >
3) Modify your view class constructor:
CTestView::CTestView()
// : CFormView(CTestView::IDD)
: CExtWA < CExtAFV < CFormView > >
( CTestView::IDD, ((CWnd *)NULL) )
4) Now your form view has full anchoring support (absolutely like
CExtResizableDialog
); To remove scroll bars please add
WM_SIZE
message handler like this:
void CTestView::OnSize(UINT nType, int cx, int cy)
{
// CFormView::OnSize(nType, cx, cy);
CWnd::OnSize(nType, cx, cy);
}
5) That’s all :-)
Best regards, Sergiy.