我从CListView继承出来的类,编译出错:error C2504: 'CListView' : base class undefined
error C2440: 'return' : cannot convert from 'class CSpeechListView *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2653: 'CListView' : is not a class or namespace name
error C2065: 'classCListView' : undeclared identifier
error C2653: 'CListView' : is not a class or namespace name
error C2653: 'CListView' : is not a class or namespace name
error C2653: 'CListView' : is not a class or namespace name
error C2065: 'm_pDocument' : undeclared identifier
error C2227: left of '->IsKindOf' must point to class/struct/union
我是单文档,加了Doc头文件;DECLARE_DYNCREATE(CSpeechListView);
MPLEMENT_DYNCREATE(CSpeechListView, CListView);错误在这里
error C2440: 'return' : cannot convert from 'class CSpeechListView *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2653: 'CListView' : is not a class or namespace name
error C2065: 'classCListView' : undeclared identifier
error C2653: 'CListView' : is not a class or namespace name
error C2653: 'CListView' : is not a class or namespace name
error C2653: 'CListView' : is not a class or namespace name
error C2065: 'm_pDocument' : undeclared identifier
error C2227: left of '->IsKindOf' must point to class/struct/union
我是单文档,加了Doc头文件;DECLARE_DYNCREATE(CSpeechListView);
MPLEMENT_DYNCREATE(CSpeechListView, CListView);错误在这里
IMPLEMENT_DYNCREATE(CSpeechListView, CListView)CSpeechListView::CSpeechListView()
{
}CSpeechListView::~CSpeechListView()
{
}
BEGIN_MESSAGE_MAP(CSpeechListView, CListView)
//{{AFX_MSG_MAP(CSpeechListView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CSpeechListView drawingvoid CSpeechListView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// CListCtrl& refCtrl = GetListCtrl();
// refCtrl.InsertItem(0, "Item!");
}/////////////////////////////////////////////////////////////////////////////
// CSpeechListView diagnostics#ifdef _DEBUG
void CSpeechListView::AssertValid() const
{
CListView::AssertValid();
}void CSpeechListView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
{
protected:
CSpeechListView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CSpeechListView)//出错
IMPLEMENT_DYNCREATE(CSpeechListView, CListView)//出错CSpeechListView::CSpeechListView()
{
}CSpeechListView::~CSpeechListView()
{
}
BEGIN_MESSAGE_MAP(CSpeechListView, CListView)
//{{AFX_MSG_MAP(CSpeechListView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CSpeechListView drawingvoid CSpeechListView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// CListCtrl& refCtrl = GetListCtrl();
// refCtrl.InsertItem(0, "Item!");
}/////////////////////////////////////////////////////////////////////////////
// CSpeechListView diagnostics#ifdef _DEBUG
void CSpeechListView::AssertValid() const
{
CListView::AssertValid();//出错
}void CSpeechListView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);//出错
}
#endif //_DEBUG