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 CMapStringToPtr

Serializing CMapStringToPtr

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
2 Posts 2 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.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    I am serializing CMapStringToPtr object without any problem, key by key, pointer to pointer. For this case, the key order it is matter. So, if I archive this CMapStringToPtr object, and de-archive on the same machine, the key order are fine. But, if I de-archive this object on other machine, the key order are not the same, and this is a PROBLEM. How can avoid this issue ? Yes, I could serialize another CStringArray with the CMapStringToPtr keys, but I don't know if this a good idea ... can you tell me how to overcome this problem ? Thank you.

    CPalliniC 1 Reply Last reply
    0
    • _ _Flaviu

      I am serializing CMapStringToPtr object without any problem, key by key, pointer to pointer. For this case, the key order it is matter. So, if I archive this CMapStringToPtr object, and de-archive on the same machine, the key order are fine. But, if I de-archive this object on other machine, the key order are not the same, and this is a PROBLEM. How can avoid this issue ? Yes, I could serialize another CStringArray with the CMapStringToPtr keys, but I don't know if this a good idea ... can you tell me how to overcome this problem ? Thank you.

      CPalliniC Online
      CPalliniC Online
      CPallini
      wrote on last edited by
      #2

      Key order is not a property of such a collection (see the documentation[^]) unlike, for instance, the std::map. So yes, you have to work around that.

      In testa che avete, signor di Ceprano?

      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