CRecordView::CRecordView
When you create an object of a type derived from CRecordView, call either form of the constructor to initialize the view object and identify the dialog resource on which the view is based.
explicit CRecordView(
LPCTSTR lpszTemplateName
);
explicit CRecordView(
UINT nIDTemplate
);
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
You can either identify the resource by name (pass a string as the argument to the constructor) or by its ID (pass an unsigned integer as the argument). Using a resource ID is recommended.
备注
Your derived class must supply its own constructor. In the constructor of your derived class, call the constructor CRecordView::CRecordView with the resource name or ID as an argument, as shown in the example below.
CRecordView::OnInitialUpdate calls UpdateData, which calls DoDataExchange. This initial call to DoDataExchange connects CRecordView controls (indirectly) to CRecordset field data members created by ClassWizard. These data members cannot be used until after you call the base class CFormView::OnInitialUpdate member function.
备注
If you use ClassWizard, the wizard defines an enum value CRecordView::IDD, specifies it in the class declaration, and uses it in the member initialization list for the constructor.
Example
CMyRecordView::CMyRecordView()
: CRecordView(CMyRecordView::IDD)
{
m_pSet = NULL;
// TODO: add construction code here
}
Requirements
Header: afxdb.h