Class CxxxxView:CFormView
-
I am using VC 6.0. I would like to create a CFormView based project by using ClassWizard, so that I can see the following line in the CxxxxView class.
Class CxxxxView:CFormView
{
....
....
}Please tell me how to do this using ClassWizard, Thanks
-
I am using VC 6.0. I would like to create a CFormView based project by using ClassWizard, so that I can see the following line in the CxxxxView class.
Class CxxxxView:CFormView
{
....
....
}Please tell me how to do this using ClassWizard, Thanks
The base view class to be used can be selected from the second last page I guess. Click on your view class and select its base class. The default is CView.
«_Superman_» _I love work. It gives me something to do between weekends.
-
The base view class to be used can be selected from the second last page I guess. Click on your view class and select its base class. The default is CView.
«_Superman_» _I love work. It gives me something to do between weekends.
Thanks you superman for your reply. Another question concerns the following code snippet. I wonder why
CListView::OnInitialUpdate();
can be called directly, without declaring an instance of the class CListView.
void CMyListView::OnInitialUpdate()
{
CListView::OnInitialUpdate();// this code only works for a report-mode list view
ASSERT(GetStyle() & LVS_REPORT);// Gain a reference to the list control itself
CListCtrl& theCtrl = GetListCtrl();// Insert a column. This override is the most convenient.
theCtrl.InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);// The other InsertColumn() override requires an initialized
// LVCOLUMN structure.
LVCOLUMN col;
col.mask = LVCF_FMT | LVCF_TEXT;
col.pszText = _T("Jersey Number");
col.fmt = LVCFMT_LEFT;
theCtrl.InsertColumn(1, &col);// Set reasonable widths for our columns
-
Thanks you superman for your reply. Another question concerns the following code snippet. I wonder why
CListView::OnInitialUpdate();
can be called directly, without declaring an instance of the class CListView.
void CMyListView::OnInitialUpdate()
{
CListView::OnInitialUpdate();// this code only works for a report-mode list view
ASSERT(GetStyle() & LVS_REPORT);// Gain a reference to the list control itself
CListCtrl& theCtrl = GetListCtrl();// Insert a column. This override is the most convenient.
theCtrl.InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);// The other InsertColumn() override requires an initialized
// LVCOLUMN structure.
LVCOLUMN col;
col.mask = LVCF_FMT | LVCF_TEXT;
col.pszText = _T("Jersey Number");
col.fmt = LVCFMT_LEFT;
theCtrl.InsertColumn(1, &col);// Set reasonable widths for our columns
CListView
is the base class ofCMyListView
. The object already existing is made of both these classes and of course the other base classes. So creating another object will not effect the current object. Also, this is the way the overridden derived class function calls the base class function.«_Superman_» _I love work. It gives me something to do between weekends.
-
Thanks you superman for your reply. Another question concerns the following code snippet. I wonder why
CListView::OnInitialUpdate();
can be called directly, without declaring an instance of the class CListView.
void CMyListView::OnInitialUpdate()
{
CListView::OnInitialUpdate();// this code only works for a report-mode list view
ASSERT(GetStyle() & LVS_REPORT);// Gain a reference to the list control itself
CListCtrl& theCtrl = GetListCtrl();// Insert a column. This override is the most convenient.
theCtrl.InsertColumn(0, _T("Player Name"), LVCFMT_LEFT);// The other InsertColumn() override requires an initialized
// LVCOLUMN structure.
LVCOLUMN col;
col.mask = LVCF_FMT | LVCF_TEXT;
col.pszText = _T("Jersey Number");
col.fmt = LVCFMT_LEFT;
theCtrl.InsertColumn(1, &col);// Set reasonable widths for our columns
CListView::OnInitialUpdate(); is equals this->CListView::OnInitialUpdate(); CMyListView is derived from CListView. It can derives base class's function {public, protected}. OnInitialUpdate is the virtual function. CListView::OnInitialUpdate() means call the base class 's function OnInitialUpdate() . I think that you should read <> <> firstly.
-
CListView::OnInitialUpdate(); is equals this->CListView::OnInitialUpdate(); CMyListView is derived from CListView. It can derives base class's function {public, protected}. OnInitialUpdate is the virtual function. CListView::OnInitialUpdate() means call the base class 's function OnInitialUpdate() . I think that you should read <> <> firstly.
Thanks for your attention on my postinngs and your replyes.