CFormView::CFormView

CFormView(LPCTSTRlpszTemplateName**);**

CFormView(UINTnIDTemplate**);**

Parameters

lpszTemplateName

Contains a null-terminated string that is the name of a dialog-template resource.

nIDTemplate

Contains the ID number of a dialog-template resource.

Remarks

When you create an object of a type derived from CFormView, invoke one of the constructors to create the view object and identify the dialog resource on which the view is based. You can identify the resource either by name (pass a string as the argument to the constructor) or by its ID (pass an unsigned integer as the argument).

The form-view window and child controls are not created until CWnd::Create is called. CWnd::Create is called by the framework as part of the document and view creation process, which is driven by the document template.

Note   Your derived class must supply its own constructor. In the constructor, invoke the constructor, CFormView::CFormView, with the resource name or ID as an argument as shown in the preceding class overview.

Example

// MyView.h.

//////////////////////////////////////////////////////
// CMyView form view.

class CMyView : public CFormView
{
   DECLARE_DYNCREATE(CMyView)

// Protected constructor used by dynamic creation.
protected:
   CMyView(); 

// Form Data.
public:
   //{{AFX_DATA(CMyView)
   enum { IDD = IDD_MYFORM };
   //}}AFX_DATA

   // Other members and methods ...

   // Generated message map functions.
   //{{AFX_MSG(CMyView)
   //}}AFX_MSG
   DECLARE_MESSAGE_MAP()
};

//////////////////////////////////////////////////////


// MyView.cpp.

#include "MyView.h"

//////////////////////////////////////////////////////
// CMyView

IMPLEMENT_DYNCREATE(CMyView, CFormView)

CMyView::CMyView()
   : CFormView(CMyView::IDD)
{
   //{{AFX_DATA_INIT(CMyView)
   //}}AFX_DATA_INIT
}
//////////////////////////////////////////////////////

// Other methods and handlers ...

CFormView OverviewClass MembersHierarchy Chart

See Also   CWnd::Create