Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The controls on the CRecordview based views doesn't work.I tried by using a list control and sending the AddString().But nothing happens when I run the progam.Can anybody explain this stuff for me?.
Posted
Comments
LaxmikantYadav 17-Mar-11 6:27am    
Please post your code here, without code no one can help you.
Mr. Tomay 21-Mar-11 12:00pm    
Laxmikant_Yadav is right. We can't even know what you are talking about

1 solution

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. 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 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.
Note If you use ClassWizard, the wizard defines an enum value CRecordView::IDD and specifies it in the member initialization list for the constructor where you see IDD_MYFORM in the example. The example shows how you can specify the dialog template resource ID if you write the code yourself without the wizard.
Example
CMyRecordView::CMyRecordView()
: CRecordView( IDD_MYFORM )
{
//{{AFX_DATA_INIT( CMyRecordView )
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Other construction code, such as data initialization
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900