# include "Glava.h"
class CGlavas: public CObArray
{
public:
void DeleteGlavas ();
};
Glavas.cpp:
# include "Stdafx.h"
# include "Glavas.h"
void CGlavas :: DeleteGlavas ()
{
WORD Counter;
for (Counter = 0; Counter
{
CGlava * Glava = (CGlava *) GetAt (Counter);
Glava-> GetPages () -> DeletePages ();
delete Glava;
}
RemoveAll ();
}
Glava.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000
# include "Pages.h"
class CGlava: public CObject
{
DECLARE_SERIAL (CGlava)
private:
CPages m_Pages;
CString m_Name;
WORD m_FirstPage;
WORD m_LastPage;
public:
CPages * GetPages ()
{
return & M_Pages;
}
CString * GetName ()
{
return & M_Name;
}
WORD GetFirstPage ()
{
return m_FirstPage;}
void SetFirstPage (WORD FirstPage)
{
m_FirstPage = FirstPage;
}
WORD GetLastPage ()
{
return m_LastPage;
}
void SetLastPage (WORD LastPage)
{
m_LastPage = LastPage;
}
CGlava () {};
void Serialize (CArchive &);
};
Glava.cpp:
# include "Stdafx.h"
# include "Glava.h"
IMPLEMENT_SERIAL (CGlava, CObject, 0)
void CGlava :: Serialize (CArchive & ar)
{
CObject :: Serialize (ar);
if (ar.IsLoading ())
{
ar>> m_Name>> m_FirstPage>> m_LastPage;
WORD Count, Counter;
ar>> Count;
for (Counter = 0; Counter
{
CPage * Page = new CPage;
Page-> Serialize (ar);
m_Pages.Add (Page);
}
}
}
Pages.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000
# include "Page.h"
class CPages: public CObArray
{
public:
void DeletePages ();
};
Pages.cpp:
# include "Stdafx.h"
# include "Pages.h"
void CPages :: DeletePages ()
{
WORD Counter;
for (Counter = 0; Counter
{
CPage * Page = (CPage *) GetAt (Counter);
delete Page;
}
RemoveAll ();
}
Page.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000
# define CountOfStrings 37
class CPage: public CObject
...