Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can I serialize COleDateTime object?

Can I serialize COleDateTime object?

Scheduled Pinned Locked Moved C / C++ / MFC
question
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NoName II
    wrote on last edited by
    #1

    the subject...

    N N 2 Replies Last reply
    0
    • N NoName II

      the subject...

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Yeah you can.


      Nibu thomas Software Developer Faqs by Michael dunn

      N 1 Reply Last reply
      0
      • N Nibu babu thomas

        Yeah you can.


        Nibu thomas Software Developer Faqs by Michael dunn

        N Offline
        N Offline
        NoName II
        wrote on last edited by
        #3

        write smth like it class MyClass : public CObject{ public: MyClass(); virtual ~MyClass(); virtual void Serialize(CArchive& ar); COleDateTime m_tmDate; }; ar<>m_tmDate.m_dt; ar>>(int)m_tmDate.m_status; as result: error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)

        N 1 Reply Last reply
        0
        • N NoName II

          write smth like it class MyClass : public CObject{ public: MyClass(); virtual ~MyClass(); virtual void Serialize(CArchive& ar); COleDateTime m_tmDate; }; ar<>m_tmDate.m_dt; ar>>(int)m_tmDate.m_status; as result: error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)

          N Offline
          N Offline
          Nibu babu thomas
          wrote on last edited by
          #4

          NoName II wrote:

          ar<>m_tmDate.m_dt; ar>>(int)m_tmDate.m_status;

          ar<>m_tmDate;

          Tell the class to do the stuff. You are trying to help too much!:)


          Nibu thomas Software Developer Faqs by Michael dunn

          N 2 Replies Last reply
          0
          • N Nibu babu thomas

            NoName II wrote:

            ar<>m_tmDate.m_dt; ar>>(int)m_tmDate.m_status;

            ar<>m_tmDate;

            Tell the class to do the stuff. You are trying to help too much!:)


            Nibu thomas Software Developer Faqs by Michael dunn

            N Offline
            N Offline
            NoName II
            wrote on last edited by
            #5

            what's mean "An attempt was made to access an unnamed file past its end CFile file; if(!file.Open(_T("persons.dat"),CFile::modeRead)){ AfxMessageBox(_T("Unable to open the file")); exit(-1); } CArchive arr(&file,CArchive::load); m_obDebtors.Serialize(arr); arr.Close(); file.Close();

            1 Reply Last reply
            0
            • N Nibu babu thomas

              NoName II wrote:

              ar<>m_tmDate.m_dt; ar>>(int)m_tmDate.m_status;

              ar<>m_tmDate;

              Tell the class to do the stuff. You are trying to help too much!:)


              Nibu thomas Software Developer Faqs by Michael dunn

              N Offline
              N Offline
              NoName II
              wrote on last edited by
              #6

              what's mean "An attempt was made to access an unnamed file past its end CFile file; if(!file.Open(_T("persons.dat"),CFile::modeRead)){ AfxMessageBox(_T("Unable to open the file")); exit(-1); } CArchive arr(&file,CArchive::load); m_obDebtors.Serialize(arr); arr.Close(); file.Close();

              1 Reply Last reply
              0
              • N NoName II

                the subject...

                N Offline
                N Offline
                NoName II
                wrote on last edited by
                #7

                what's mean "An attempt was made to access an unnamed file past its end CFile file; if(!file.Open(_T("persons.dat"),CFile::modeRead)){ AfxMessageBox(_T("Unable to open the file")); exit(-1); } CArchive arr(&file,CArchive::load); m_obDebtors.Serialize(arr); arr.Close(); file.Close();

                C 1 Reply Last reply
                0
                • N NoName II

                  what's mean "An attempt was made to access an unnamed file past its end CFile file; if(!file.Open(_T("persons.dat"),CFile::modeRead)){ AfxMessageBox(_T("Unable to open the file")); exit(-1); } CArchive arr(&file,CArchive::load); m_obDebtors.Serialize(arr); arr.Close(); file.Close();

                  C Offline
                  C Offline
                  Cedric Moonen
                  wrote on last edited by
                  #8

                  NoName II wrote:

                  "An attempt was made to access an unnamed file past its end

                  I never heard about this error. It's perhaps because you try to load more objects than the file contains. So, you try to read after the end of the file. Can you confirm that your load and save parts serialize exactly the same objects in the same order ?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups