Click here to Skip to main content
15,900,907 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unzip a file through VC++ Pin
Bjarke Viksoe7-Jul-01 4:55
Bjarke Viksoe7-Jul-01 4:55 
GeneralRe: Unzip a file through VC++ Pin
9-Jul-01 2:20
suss9-Jul-01 2:20 
GeneralSerializing a linked_list class, HELP Pin
mr20036-Jul-01 3:26
mr20036-Jul-01 3:26 
GeneralRe: Serializing a linked_list class, HELP Pin
Tomasz Sowinski6-Jul-01 3:40
Tomasz Sowinski6-Jul-01 3:40 
GeneralRe: Serializing a linked_list class, HELP Pin
mr20036-Jul-01 4:52
mr20036-Jul-01 4:52 
GeneralRe: Serializing a linked_list class, HELP Pin
Tomasz Sowinski6-Jul-01 5:17
Tomasz Sowinski6-Jul-01 5:17 
GeneralRe: Serializing a linked_list class, HELP Pin
mr20036-Jul-01 7:02
mr20036-Jul-01 7:02 
GeneralSerializing a linked_list class Pin
mr20036-Jul-01 3:25
mr20036-Jul-01 3:25 
Hi,
I have a linked_list class, and item class.
class item : public CObject
{
DECLARE_SERIAL(item)
public:
virtual void Serialize(CArchive& ar);

int Angle_D;
CPoint Coord;
int value;
item* next;

}
class linked_list : public CObject
{
DECLARE_SERIAL(linked_list)
public:
virtual void Serialize(CArchive& ar);
void add(int Intensity, CPoint coord, double angle_D);
CPoint m_PCenter;
int HowBig();
void Del ();
linked_list();
virtual ~linked_list();


private:
item* start;
};

i added class item in the header file of my linked_list class.
In my application(MDI) i have a linked_list vairable ( mylist).
so when i want to serialize it, i just:

void CTurboMechDoc::Serialize(CArchive& ar)
{
mylist.Serialize(ar);
}
then in linked_list class:

void linked_list::Serialize(CArchive &ar)
{
item* ptr= start;
CObject ::Serialize(ar);

while(ptr->next != NULL)
{
ptr->Serialize(ar);
ptr=ptr->next;
}
}

and finally in class item:
void item::Serialize(CArchive &ar)
{
CObject::Serialize(ar);

if(ar.IsStoring())
{
ar << Coord;
}
else
ar >> Coord;
}

and i did write IMPLEMENT_SERIAL(classname, CObject,1) for linked_list and item class.
ofcourse the file linked_list.cpp contains the implimentations of both item class and linked)list.
i do have a bitmap displayed as well, but i didn't serialize that.
the problem is that it doesn't work.
can anyone help me?

Ehsan
Eek! | :eek: Eek! | :eek:

Ehsan Behboudi
GeneralMenubar in doc/view Pin
EiSl6-Jul-01 1:56
EiSl6-Jul-01 1:56 
GeneralRe: Menubar in doc/view Pin
Tomasz Sowinski6-Jul-01 2:20
Tomasz Sowinski6-Jul-01 2:20 
GeneralWeb Service Pin
6-Jul-01 1:29
suss6-Jul-01 1:29 
GeneralRe: Web Service Pin
Tomasz Sowinski6-Jul-01 1:45
Tomasz Sowinski6-Jul-01 1:45 
GeneralRe: Web Service Pin
6-Jul-01 2:33
suss6-Jul-01 2:33 
GeneralRe: Web Service Pin
Tomasz Sowinski6-Jul-01 2:40
Tomasz Sowinski6-Jul-01 2:40 
GeneralRe: Web Service Pin
6-Jul-01 2:48
suss6-Jul-01 2:48 
GeneralRe: Web Service Pin
Tomasz Sowinski6-Jul-01 2:57
Tomasz Sowinski6-Jul-01 2:57 
GeneralRe: Web Service Pin
6-Jul-01 3:16
suss6-Jul-01 3:16 
QuestionDoes HTTP SendRequest block? Pin
neilbennevis6-Jul-01 0:41
neilbennevis6-Jul-01 0:41 
QuestionIs there any smart people? Pin
5-Jul-01 21:39
suss5-Jul-01 21:39 
AnswerRe: Is there any smart people? Pin
6-Jul-01 3:34
suss6-Jul-01 3:34 
GeneralRe: Is there any smart people? Pin
6-Jul-01 4:15
suss6-Jul-01 4:15 
AnswerRe: Is there any smart people? Pin
#realJSOP6-Jul-01 4:45
professional#realJSOP6-Jul-01 4:45 
GeneralRe: Is there any smart people? Pin
6-Jul-01 12:34
suss6-Jul-01 12:34 
GeneralRe: Is there any smart people? Pin
Sunitha L25-Sep-02 11:22
Sunitha L25-Sep-02 11:22 
GeneralRe: pointer to a function Pin
@deel@bbas5-Jul-01 20:11
@deel@bbas5-Jul-01 20:11 

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.