vc6+sp5编译问题
我建立了一个单文档的程序但是在编译时
class CMy2DCADView : public CView
{
protected: // create from serialization only
CMy2DCADView();
DECLARE_DYNCREATE(CMy2DCADView)
// Attributes
public:
CMy2DCADDoc* GetDocument();//这里出现3个错误
d:\vc\2dcad\2dcadview.h(21) : error C2143: syntax error : missing ';' before '*'
d:\vc\2dcad\2dcadview.h(21) : error C2501: 'CMy2DCADDoc' : missing storage-class or type specifiers
d:\vc\2dcad\2dcadview.h(21) : error C2501: 'GetDocument' : missing storage-class or type specifiers
把//CMy2DCADDoc* GetDocument();注释掉后再编译出现两个错误:
D:\vc\2DCAD\2DCADView.cpp(71) : error C2440: 'initializing' : cannot convert from 'class CDocument *' to 'class CMy2DCADDoc *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
D:\vc\2DCAD\2DCADView.cpp(110) : error C2509: 'GetDocument' : member function not declared in 'CMy2DCADView'
d:\vc\2dcad\2dcadview.h(13) : see declaration of 'CMy2DCADView'
再把注释去掉以后就编译成功了。
每次都这样做无用功很ft!
有没有解决的办法啊???