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. Serializing multiple dynamic objects

Serializing multiple dynamic objects

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
3 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.
  • F Offline
    F Offline
    Frank Christensen
    wrote on last edited by
    #1

    Hi Im trying to figure out subject but I cant get it to work. I have no problem saving but when I want to load the data again I have to somehow know what type of object it is and then create it...how do I do that? Tnx in advance!!!

    M B 2 Replies Last reply
    0
    • F Frank Christensen

      Hi Im trying to figure out subject but I cant get it to work. I have no problem saving but when I want to load the data again I have to somehow know what type of object it is and then create it...how do I do that? Tnx in advance!!!

      M Offline
      M Offline
      Martyn Pearson
      wrote on last edited by
      #2

      The easiest way is to precede the class in the file with an enumerator that indicates what sort of object follows.

      1 Reply Last reply
      0
      • F Frank Christensen

        Hi Im trying to figure out subject but I cant get it to work. I have no problem saving but when I want to load the data again I have to somehow know what type of object it is and then create it...how do I do that? Tnx in advance!!!

        B Offline
        B Offline
        BadJerry
        wrote on last edited by
        #3

        Why don't you put all your objects in a CObArray and use the CObArray::Serialize to read and write?

        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