1
if(archive.IsStoring())
archive << SubKeys;
else
  archive >> SubKeys;
修改为这样如何?

SubKeys是什么类型的?

解决方案 »

  1.   

    编译通过,但是执行时报错:no operator defined which takes a left-hand operand of type 'class CArchive' (or there is no acceptable conversion)
    -------
    指向你代码中的哪行??
    arStore << my_des; 这个???
      

  2.   

    SubKeys是类yxyDES的成员变量类型如下:
            char SubKeys[16][48];
            char SubKeys2[16][48];
            char szCiphertext[16];
            char szPlaintext[8];
            char szFCiphertextAnyLength[8192];
            char szFPlaintextAnyLength[4096];
      

  3.   

     void yxyDES::Serialize(CArchive &archive)
    {
      CObject::Serialize(archive);
      if(archive.IsStoring())
    archive << SubKeys << SubKeys2 << szCiphertext << szFCiphertextAnyLength
      << szPlaintext << szFPlaintextAnyLength;
    else
      archive >> SubKeys >> SubKeys2 >> szCiphertext >> szFCiphertextAnyLength
      >> szPlaintext >> szFPlaintextAnyLength;
    }
    指向的就是带“<<”和“>>”的行
    my_des是yxyDES类的对象啊
      

  4.   

    你要用 arStore << &my_des;  <--- 加&试一下看可否
      

  5.   

     arStore << my_des;
    换成
    my_des—>Serialize(arStore );
    试试
      

  6.   

    或者 
    arStore.WriteObject(my_des);