如题。我新建一个类,并将该类的基类设置为CTreeView,新建后编译,不知怎么回事,却发现有9个错误。错误信息如下:--------------------Configuration: TvwDemo - Win32 Debug--------------------
Compiling...
TvwList.cpp
d:\tvwdemo\tvwlist.h(14) : error C2504: 'CTreeView' : base class undefined
D:\TvwDemo\TvwList.cpp(16) : error C2440: 'return' : cannot convert from 'class CTvwList *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\TvwDemo\TvwList.cpp(16) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(16) : error C2065: 'classCTreeView' : undeclared identifier
D:\TvwDemo\TvwList.cpp(27) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(38) : error C2065: 'GetDocument' : undeclared identifier
D:\TvwDemo\TvwList.cpp(38) : error C2440: 'initializing' : cannot convert from 'int' to 'class CDocument *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
D:\TvwDemo\TvwList.cpp(48) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(53) : error C2653: 'CTreeView' : is not a class or namespace name
Error executing cl.exe.TvwDemo.exe - 9 error(s), 0 warning(s)还望高手指点.谢谢!
Compiling...
TvwList.cpp
d:\tvwdemo\tvwlist.h(14) : error C2504: 'CTreeView' : base class undefined
D:\TvwDemo\TvwList.cpp(16) : error C2440: 'return' : cannot convert from 'class CTvwList *' to 'class CObject *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\TvwDemo\TvwList.cpp(16) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(16) : error C2065: 'classCTreeView' : undeclared identifier
D:\TvwDemo\TvwList.cpp(27) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(38) : error C2065: 'GetDocument' : undeclared identifier
D:\TvwDemo\TvwList.cpp(38) : error C2440: 'initializing' : cannot convert from 'int' to 'class CDocument *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
D:\TvwDemo\TvwList.cpp(48) : error C2653: 'CTreeView' : is not a class or namespace name
D:\TvwDemo\TvwList.cpp(53) : error C2653: 'CTreeView' : is not a class or namespace name
Error executing cl.exe.TvwDemo.exe - 9 error(s), 0 warning(s)还望高手指点.谢谢!
D:\TvwDemo\TvwList.cpp(7) : fatal error C1083: Cannot open include file: 'TreeView.h': No such file or directory
Error executing cl.exe.
从MSDN里面找一下'CTreeView' 对应的头文件,包含它就是了
#ifndef __AFXCVIEW_H__
#include <afxcview.h>
#endif谢谢诸位!