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. Problems serializing data structures (2)

Problems serializing data structures (2)

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestiondebuggingworkspace
1 Posts 1 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.
  • J Offline
    J Offline
    JCpp
    wrote on last edited by
    #1

    First of all excuse my english... (I'm just a begginer) I've posted a question about serializing Data structures and I have followed the instructions of the scribble sample, but I get an error when loading data from disk. My data structures are these ones: struct STRCTxDATA { this struct contains BOOL, int, HANDLE, DCB, CString, COMMTIMEOUTS, UINT... }; struct STRCTxTEXT { This struct contains only CStrings... }; struct WRKSTRCTS // To ensure that the two structures are linked... { STRCTxDATA *WRKSTRCTDADES; STRCTxTEXT *WRKSTRCTDESCRIPCIONS; }; Now I would like to save/load those structures... (they are used to create a configuration file for the communication devices) NOTE: those structures are placed in a CArray. void CGenCFGDoc::Serialize(CArchive& ar) { int iItemCounter = 0; char chSeparator = '\0'; m_bModified = FALSE; if (ar.IsStoring()) { ar << ArrayxCFG.GetUpperBound() + 1; ar << chSeparator; } else { ar >> iItemCounter; ar >> chSeparator; } ArrayxCFG.Serialize(ar); TRACE ("\nSERIALIZATION RESULTS:\n----------------------\n# Items: %i\n",iItemCounter); for (int iCounter = 0; iCounter <= ArrayxCFG.GetUpperBound(); iCounter++) { TRACE("%s\n",ArrayxCFG[iCounter].WRKSTRCTDADES->csCadDCB); // <<-- Here I got the error. } } Could you help me? Thank you in advance...

    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