当前位置:首页 > 技术问答集
firefox

一个奇怪的问题,大侠请进

 所属目录:Java   |   类型:技术问答   |   时间:2007-05-21
 问题:

在看孙鑫的vc++20集,在第7集里做一个画图的程序,跟着做下来却出了问题,一个类的定义如下:  
   
  class   cpantodrwdoc   :   public   cdocument   //在这里有错误,提示:  
   
  //             f:\myproject\pantodrw\pantodrw\pantodrwdoc.h(29)   :   error   c2236:   unexpected   class   cpantodrwdoc  
   
  {  
  protected:  
  //建立存储直线的数组  
  ctypedptrarray<cobarray,   cline*>   s_linearray;  
  public:  
  void   addline(point   beginp,   point   endp);//存储直线数据  
  cline   *getline(int   index);//获得指定被存储直线的数据  
  int   getnumlines();//获得已经绘制直线的总数量  
  protected:   //   create   from   serialization   only  
  cpantodrwdoc();  
  declare_dyncreate(cpantodrwdoc)  
   
  //   attributes  
  public:  
   
  //   operations  
  public:  
   
  //   overrides  
  //   classwizard   generated   virtual   function   overrides  
  //{{afx_virtual(cpantodrwdoc)  
  public:  
  virtual   bool   onnewdocument();  
  virtual   void   serialize(carchive&   ar);  
  //}}afx_virtual  
   
  //   implementation  
  public:  
  virtual   ~cpantodrwdoc();  
  #ifdef   _debug  
  virtual   void   assertvalid()   const;  
  virtual   void   dump(cdumpcontext&   dc)   const;  
  #endif  
   
  protected:  
   
  //   generated   message   map   functions  
  protected:  
  //{{afx_msg(cpantodrwdoc)  
  //   note   -   the   classwizard   will   add   and   remove   member   functions   here.  
  //         do   not   edit   what   you   see   in   these   blocks   of   generated   code   !  
  //}}afx_msg  
  declare_message_map()  
  };  
  请大侠帮忙看看,在线等,也可以加我qq532138820,多谢!!!!

· 网友精彩回答:

发表者:dirdirdir3

头文件include了没有,  
  #include   "stdafx.h"

发表者:happyparrot

class   cpantodrwdoc   :   public   cdocument   //在这里有错误,提示:  
  --你最好将这行前的内容也都贴出来。

发表者:vcmute

上句加;

.
© 2006-2008 All Rights Reserved