file.Seek(0x37,CFile::begin);
这个CFile::bein是在哪里定义的???为什么输代码时智能咸知不提示,而实际上确实有该常量存在???

解决方案 »

  1.   

    Seek(
       LONGLONG lOff,
       UINT nFrom 
    );
    //Seek函数的参数第二个里可以取
    nFrom CFile::begin   
    Move the file pointer lOff bytes forward from the beginning of the file.
     
    CFile::current   
    Move the file pointer lOff bytes from the current position in the file. CFile::end   
    Move the file pointer lOff bytes from the end of the file. Note that lOff must be negative to seek into the existing file; positive values will seek past the end of the file. 
    不提示问题你可以把工程的.clw文件删除了试
      

  2.   

    是的,它存在,不只它存在,它还有一伙兄弟也存在,查MSDN你可见到他们这个你说的怪,其实是CFile里的static类型的成员,说是变量,其实它和成员函数的特性一样,属于男扮女装之列,。其实你不用了解这么多,又是一个话题了
      

  3.   

    CFile::begin中的begin是CFile类的一个static变量;类的static成员不依附于一个类对象!而是属于整个类!也就是说你不需要去定义一个CFile的类就可以通过::符号访问它!
      

  4.   

    enum SeekPosition { begin = 0x0, current = 0x1, end = 0x2 };这是个enum,不是static变量!
    本质上只是个宏,不占用任何内存!
    因为定义在类里,所以访问的话需要在前面加上类定义可以删除工程的以ncb、aps和clw结尾的文件(每个只有一个!)
    在进去工程后按“Ctrl+W”,重新构建ClassWizard
      

  5.   

    CFile::begin是CFile类中的一个静态变量!!!!!!!
    class CFile
    {
      .....
      static begin;
      .....
    }
      

  6.   

    sorry!
    上面有错,支持roger_ding(海天一色) ^_^
      

  7.   

    roger_ding(海天一色) ( ) 说得是对的。
    下面是Afx.h中的定义:
    enum SeekPosition { begin = 0x0, current = 0x1, end = 0x2 };给分了,同时对各位的参与表示感谢。