Click here to Skip to main content
16,006,475 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error Pin
David Crow16-Dec-04 4:08
David Crow16-Dec-04 4:08 
GeneralRe: error Pin
ozgul16-Dec-04 4:51
ozgul16-Dec-04 4:51 
GeneralRe: error Pin
toxcct16-Dec-04 5:03
toxcct16-Dec-04 5:03 
GeneralRe: error Pin
Antony M Kancidrowski16-Dec-04 7:16
Antony M Kancidrowski16-Dec-04 7:16 
GeneralRe: error Pin
Maximilien16-Dec-04 4:45
Maximilien16-Dec-04 4:45 
GeneralRe: error Pin
toxcct16-Dec-04 4:56
toxcct16-Dec-04 4:56 
GeneralRe: error Pin
ozgul16-Dec-04 21:43
ozgul16-Dec-04 21:43 
Questionhow to read in serialized list structures? Pin
itsh1116-Dec-04 3:18
itsh1116-Dec-04 3:18 
hello everyone,

I am trying to read in a list structure which is serialized as

m_DataPointerList.Serialize( ar );

where m_DataPointerList is defined as :

CTypedPtrList m_DataPointerList;

and class CDataPointer is declared as:

class CDataPointer : public CObject
{
public:
CDataPointer();

protected:
DECLARE_SERIAL(CDataPointer)

protected:

public:
unsigned long Time; unsigned char Channel;
unsigned char Rate;

public:
virtual void Serialize(CArchive& ar);
};

and defined as:

IMPLEMENT_SERIAL(CDataPointer, CObject, 1)
CDataPointer::CDataPointer()
{

}

void CDataPointer::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << Time;
ar << Channel;
ar << Rate;
}
else
{
ar >> Time;
ar >> Channel;
ar >> Rate;
}
}

I am having some difficulties( i donno why?) in reading it in using the same serializing command ie:

m_DataPointerList.Serialize( ar );

is there any thing i am overlooking while i am doing this??

on the other hand,
I try to read this using a 'for' loop
which iterates for the number of occurances of CDataPointer. but i have to add an offset at the end of every iteration if I were to read the next iteration correctly.
something like

nDataCounter=ar.ReadCount();
for(i=0;i
{
ar>>Time[i];
ar>>Channel[i];
ar>>Rate[i];

ar.Flush();
pFile->Seek(offSET, CFile::current);
}

i dont understand why i have to provide this offset.and i have trouble choosing the correct offSET as it varies for different lists. again is there something i am doing wrong ?

Can please you give me some insight into these two issues??

Thanks a lot
AnswerRe: how to read in serialized list structures?(typo corrected) Pin
itsh1116-Dec-04 4:03
itsh1116-Dec-04 4:03 
GeneralRe: how to read in serialized list structures?(typo corrected) Pin
Ravi Bhavnani16-Dec-04 9:00
professionalRavi Bhavnani16-Dec-04 9:00 
GeneralRe: how to read in serialized list structures?(typo corrected) Pin
itsh1116-Dec-04 10:38
itsh1116-Dec-04 10:38 
GeneralRe: how to read in serialized list structures?(typo corrected) Pin
Jack Puppy16-Dec-04 14:12
Jack Puppy16-Dec-04 14:12 
Questionwhat's happend? ERROR_NO_SUCH_LOGON_SESSION? Pin
starschen16-Dec-04 3:10
sussstarschen16-Dec-04 3:10 
AnswerRe: what's happend? ERROR_NO_SUCH_LOGON_SESSION? Pin
Graham Bradshaw16-Dec-04 12:08
Graham Bradshaw16-Dec-04 12:08 
GeneralRe: what's happend? ERROR_NO_SUCH_LOGON_SESSION? Pin
starschen16-Dec-04 15:07
sussstarschen16-Dec-04 15:07 
GeneralRe: Iphlpapi.h Pin
ThatsAlok16-Dec-04 2:54
ThatsAlok16-Dec-04 2:54 
GeneralRe: Iphlpapi.h Pin
Prakash Nadar16-Dec-04 3:14
Prakash Nadar16-Dec-04 3:14 
GeneralRe: Iphlpapi.h Pin
Prakash Nadar16-Dec-04 3:13
Prakash Nadar16-Dec-04 3:13 
GeneralRe: Iphlpapi.h Pin
ThatsAlok16-Dec-04 17:00
ThatsAlok16-Dec-04 17:00 
GeneralRe: Iphlpapi.h Pin
Prakash Nadar17-Dec-04 3:31
Prakash Nadar17-Dec-04 3:31 
GeneralRe: Iphlpapi.h Pin
ThatsAlok17-Dec-04 17:02
ThatsAlok17-Dec-04 17:02 
GeneralRe: Iphlpapi.h Pin
dex_ter1119-Dec-04 18:23
dex_ter1119-Dec-04 18:23 
QuestionHow to change the Color of Menu Bars? Pin
pubududilena16-Dec-04 2:02
pubududilena16-Dec-04 2:02 
GeneralCombo box values Pin
Rich Wright16-Dec-04 1:58
Rich Wright16-Dec-04 1:58 
GeneralRe: Combo box values Pin
David Crow16-Dec-04 4:14
David Crow16-Dec-04 4:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.