vc6+sp5编译问题

huigll 2003-10-21 11:27:25
我建立了一个单文档的程序但是在编译时
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!

有没有解决的办法啊???
...全文
58 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
huigll 2003-10-22
  • 打赏
  • 举报
回复
问题我自己解决了。
谢谢两位参与。
tanyaliji 2003-10-21
  • 打赏
  • 举报
回复
与注释没有关系啊 !
huigll 2003-10-21
  • 打赏
  • 举报
回复
要不我发原程序给你看看。
你发个邮件给我,我回给你。

huigll@163.com
bluebohe 2003-10-21
  • 打赏
  • 举报
回复
没有碰到过啊,我的也是VC6+SP5
huigll 2003-10-21
  • 打赏
  • 举报
回复
没有人会么?
up一下

16,470

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧