Delen via


CDaoRecordView::CDaoRecordView

When you create an object of a type derived from CDaoRecordView, call either form of the constructor to initialize the view object and identify the dialog resource on which the view is based.

explicit CDaoRecordView( 
   LPCTSTR lpszTemplateName  
); 
explicit CDaoRecordView( 
   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.

Note

Your derived class must supply its own constructor. In the constructor of your derived class, call the constructor CDaoRecordView::CDaoRecordView with the resource name or ID as an argument.

CDaoRecordView::OnInitialUpdate calls CWnd::UpdateData, which calls CWnd::DoDataExchange. This initial call to DoDataExchange connects CDaoRecordView controls (indirectly) to CDaoRecordset field data members created by ClassWizard. These data members cannot be used until after you call the base class CFormView::OnInitialUpdate member function.

Note

If you use ClassWizard, the wizard defines an enum value CDaoRecordView::IDD in the class declaration and uses it in the member initialization list for the constructor.

CMyDaoRecordView::CMyDaoRecordView()
   : CDaoRecordView(CMyDaoRecordView::IDD)
{
   m_pSet = NULL;
   // TODO: add construction code here

}

Requirements

Header: afxdao.h

See Also

Reference

CDaoRecordView Class

Hierarchy Chart

CWnd::UpdateData

CWnd::DoDataExchange