() -> GetSize (); Counter3 + +)
m_pPages.Add (Glava-> GetPages () -> GetAt (Counter3));
}
}
}
}
Razdels.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000
# include "Razdel.h"
class CRazdels: public CObArray
{
public:
void DeleteRazdels ();
};
Razdels.cpp:
# include "Stdafx.h"
;
# include "Razdels.h"
void CRazdels :: DeleteRazdels ()
{
WORD Counter;
for (Counter = 0; Counter
{
CRazdel * Razdel = (CRazdel *) GetAt (Counter);
Razdel-> GetGlavas () -> DeleteGlavas ();
delete Razdel;
}
RemoveAll ();
}
Razdel.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000
# include "Glavas.h"
class CRazdel: public CObject
{
DECLARE_SERIAL (CRazdel)
private:
CGlavas m_Glavas;
CString m_Name;
WORD m_FirstGlava;
WORD m_LastGlava;
WORD m_FirstPage;
WORD m_LastPage;
public:
CGlavas * GetGlavas ()
{
return & M_Glavas;
}
CString * GetName ()
{
return & M_Name;
}
WORD GetFirstGlava ()
{
return m_FirstGlava;
}
void SetFirstGlava (WORD FirstGlava)
{
m_FirstGlava = FirstGlava;
}
WORD GetLastGlava ()
{
return m_LastGlava;
}
void SetLastGlava (WORD LastGlava)
{
m_LastGlava = LastGlava;
}
WORD GetFirstPage ()
{
return m_FirstPage;
}
void SetFirstPage (WORD FirstPage)
{
m_FirstPage = FirstPage;
}
WORD GetLastPage ()
{
return m_LastPage;
}
void SetLastPage (WORD LastPage)
{
m_LastPage = LastPage;
}
CRazdel () {};
void Serialize (CArchive &);
};
Razdel.cpp:
# include "Stdafx.h"
# include "Razdel.h"
IMPLEMENT_SERIAL (CRazdel, CObject, 0)
void CRazdel :: Serialize (CArchive & ar)
{
CObject :: Serialize (ar);
if (ar.IsLoading ())
{
ar>> m_Name>> m_FirstGlava>> m_LastGlava>> m_FirstPage>>
m_LastPage;
WORD Count, Counter;
ar>> Count;
for (Counter = 0; Counter
{
CGlava * Glava = new CGlava;
Glava-> Serialize (ar);
m_Glavas.Add (Glava);
}
}
}
Glavas.h:
# if _MSC_VER> 1000
# pragma once
# endif// _MSC_VER> 1000 ...