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. Serialization

Serialization

Scheduled Pinned Locked Moved C / C++ / MFC
helpcssjsonquestion
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.
  • N Offline
    N Offline
    Nick Armstrong
    wrote on last edited by
    #1

    I am creating a SDI application. The document keeps track of a single instance of a grid class which I need to save the state of. I have derived the grid class from CObject and am using the Serialize member function of the document class. My problem is that it does not seem to save anything of the user-defined grid class. I tried just saving an int value as well to make sure that it was actually serializing properly and it was. I derived my class (Grid) from CObject and placed the line DECLARE_SERIAL( Grid ) in the public section, and finally placed IMPLEMENT_SERIAL(Grid,CObject,1) at the bottom of my document class but no joy. Any ideas as to what I'm doing wrong? Thanks for any help in advance Nick :confused:

    N 1 Reply Last reply
    0
    • N Nick Armstrong

      I am creating a SDI application. The document keeps track of a single instance of a grid class which I need to save the state of. I have derived the grid class from CObject and am using the Serialize member function of the document class. My problem is that it does not seem to save anything of the user-defined grid class. I tried just saving an int value as well to make sure that it was actually serializing properly and it was. I derived my class (Grid) from CObject and placed the line DECLARE_SERIAL( Grid ) in the public section, and finally placed IMPLEMENT_SERIAL(Grid,CObject,1) at the bottom of my document class but no joy. Any ideas as to what I'm doing wrong? Thanks for any help in advance Nick :confused:

      N Offline
      N Offline
      Niklas L
      wrote on last edited by
      #2

      Have you implemented the virtual function 'Serialize' in your grid class? To make your grid class reusable, put IMPLEMENT_SERIAL(Grid,CObject,1) in your grid.cpp istead. In your doc class' Serialize call: m_mygrid.Serialize(ar); In your grid class Serialize you need to store and load all grid information. /Niklas

      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