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