Serializing Data to file
-
I use the tecnique show in this article this is working fine in vc++ of visual studio 6, but in vc++ of visual studio the file is not stored properly. How should i serialize and store my data i want this to be done for a class derived from CDialog class. Thanks for your time.
-
I use the tecnique show in this article this is working fine in vc++ of visual studio 6, but in vc++ of visual studio the file is not stored properly. How should i serialize and store my data i want this to be done for a class derived from CDialog class. Thanks for your time.
oh god i am really sorry, I found the error. When i inserted the serialization using the class wizard it inserted the code as follows
if (ar.IsStoring()) { // storing code ar >> m_strName; ar >> m_nIndex; } else { // loading code ar << m_strName; ar << m_nIndex; }
note IsStoring there. and in the article the same function is as follows
if (ar.IsLoading()) // If you are loading data from the disk { ar >> m_strName; ar >> m_nIndex; } else // If you are storing data to the disk { ar << m_strName; ar << m_nIndex; }
note IsLoading here. My mistake was i used the wrong indirection. Make a note of it and never do such a stupid mistake. I wasted 5 hours on this. :((
-
oh god i am really sorry, I found the error. When i inserted the serialization using the class wizard it inserted the code as follows
if (ar.IsStoring()) { // storing code ar >> m_strName; ar >> m_nIndex; } else { // loading code ar << m_strName; ar << m_nIndex; }
note IsStoring there. and in the article the same function is as follows
if (ar.IsLoading()) // If you are loading data from the disk { ar >> m_strName; ar >> m_nIndex; } else // If you are storing data to the disk { ar << m_strName; ar << m_nIndex; }
note IsLoading here. My mistake was i used the wrong indirection. Make a note of it and never do such a stupid mistake. I wasted 5 hours on this. :((
karmendra_js wrote: I wasted 5 hours on this. It was only a waste if you failed to learn anything from the experience.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb