000
14.06.2003, 13:03 Uhr
~michael
Gast
|
Ok ich konnte nun das Problem lokalisieren (hoffe ich) Nur was is bei meiner Klasse falsch, so daß sie nicht Odnungsgemäß serialisiert wird? Ich verstehs echt nicht
C++: |
///CTermin.h class CTermin : public CObject { DECLARE_SERIAL(CTermin) public: CString GetDescription(); CString GetKind(); CTime GetTime(); void SetDescription(CString); void SetTime(int,int,int,int,int,int); void SetKind(CString kind); CTermin(); virtual ~CTermin(); virtual void Serialize (CArchive& ar); /// Zugriffsmethoden private: CString m_strDescription; CTime m_time; CString m_strKind; };
/// CTermin.cpp IMPLEMENT_SERIAL (CTermin, CObject, 1) ////////////////////////////////////////////////////////////////////// // Konstruktion/Destruktion //////////////////////////////////////////////////////////////////////
CTermin::CTermin() { m_time ; m_strDescription.Format(""); m_strKind.Format(""); }
CTermin::~CTermin() { }
void CTermin::Serialize(CArchive &ar) { /// Funktion der Basisklasse aufrufen CObject::Serialize(ar); /// Wird geschrieben oder gelesen if(ar.IsStoring()) { /// Variablen schreiben ar << m_time << m_strDescription << m_strKind; } else { /// Variablen lesen ar >> m_time >> m_strDescription >> m_strKind; } }
void CTermin::SetTime(int sec, int min,int hour,int day,int month, int jear) { m_time = CTime(jear,month,day,hour,min,sec); }
void CTermin::SetDescription(CString str) { m_strDescription = str; }
CString CTermin::GetDescription() { return this->m_strDescription; }
void CTermin::SetKind(CString kind) { this->m_strKind=kind; }
CString CTermin::GetKind() { return m_strKind; }
CTime CTermin::GetTime() { return m_time; }
|
Danke für die Hilfe! mfg Michael |