if (ar.IsStoring()) {
          ar << m_iControlStyle << m_iAutoControl << m_fPowerCoeff<<0xA\
<< m_fFuelTestQuantity << m_fAbsorberWaterRatio << m_sTestTime;
  }  
    else    {
          ar >> m_iControlStyle >> m_iAutoControl >> m_fPowerCoeff >>0xA\
                >> m_fFuelTestQuantity >> m_fAbsorberWaterRatio >> m_sTestTime;
    }编译错误为:
E:\TestBed\TestBedData.cpp(284) : error C2678: binary '<<' : no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion)E:\TestBed\TestBedData.cpp(289) : error C2679: binary '>>' : no operator defined which takes a right-hand operand of type 'const int' (or there is no acceptable conversion)

解决方案 »

  1.   

    or there is no acceptable conversion你看一下<<操作符后面的变量的类型是不是<<能接受的类型啊
      

  2.   

    0xA?<<并不知道其类型,>>是不能输入到一常量的。
      

  3.   

    i表示int,f表示float,s表示string   如:m_iControlStyle m_fPowerCoeff,m_sTestTime   大家帮忙修改一下,我不明白大家的意思?????
      

  4.   

    <<0xA
    它有地址吗????
      

  5.   


    说错了
    是>>0xA,能把东西弄到这个变量的地址里去吗???
      

  6.   

    我找出出错的原因了:
    (1)行尾都改为 >>0xA\
    (2)不能保存string类型的m_sTestTime数据但我要程序保存“2005 09 28 15:02”这样的数据怎么办??怎么修改(2)呢?
      

  7.   

    The overloaded extraction (>>) and insertion (<<) operators are convenient archive programming interfaces that support both primitive types and CObject-derived classes.
      

  8.   

    http://www.vckbase.com/document/viewdoc/?id=918
      

  9.   

    “2005 09 28 15:02”是什么类型的数据?Cstring吗?
      

  10.   

    用ar.Write()

    extern CArchive ar;
    char pb[100];
    ar.Write( pb, 100 );