|
#include "StdAfx.h"
#include "NotifyObject.h"
#include "NotifyObjects.h"
NotifyObjectType::NotifyObjectType( CNotifyObject * pObject )
{
m_Type = NOTIFY_INVALID_OBJECT ;
if ( pObject != NULL )
{
if ( pObject->IsKindOf( RUNTIME_CLASS( CErrorObject ) ) != FALSE )
{
m_Type = NOTIFY_ERROR_OBJECT ;
}
if ( pObject->IsKindOf( RUNTIME_CLASS( CInformationObject ) ) != FALSE )
{
m_Type = NOTIFY_INFORMATION_OBJECT ;
}
}
}
NotifyObjectType::operator long()
{
return m_Type ;
}
IMPLEMENT_SERIAL(CErrorObject, CNotifyObject, NOTIFY_ERROR_SCHEMA)
CErrorObject::CErrorObject( UINT Message, LPCTSTR ErrorMessage, NMHDR & Hdr ) : CNotifyObject( Hdr )
{
m_Message = Message ;
m_ErrorMessage = ErrorMessage ;
}
CErrorObject::CErrorObject( const CErrorObject & Object ) : CNotifyObject( Object )
{
Copy( Object ) ;
}
CErrorObject::~CErrorObject(void)
{
m_Message = 0 ;
m_ErrorMessage = _T("") ;
}
CErrorObject & CErrorObject::operator = ( const CErrorObject & Object )
{
Copy( Object ) ;
return *this ;
}
LPCTSTR CErrorObject::get_ErrorMessage()
{
return m_ErrorMessage ;
}
void CErrorObject::Copy( const CErrorObject & Object )
{
m_ErrorMessage = const_cast<CErrorObject&>(Object).m_ErrorMessage ;
CNotifyObject::Copy(Object) ;
}
IMPLEMENT_SERIAL(CInformationObject, CNotifyObject, NOTIFY_INFORMATION_SCHEMA)
CInformationObject::CInformationObject( UINT Message, LPCTSTR InformationMessage, NMHDR & Hdr ) : CNotifyObject( Hdr )
{
m_Message = Message ;
m_InformationMessage = InformationMessage ;
}
CInformationObject::CInformationObject( const CInformationObject & Object ) : CNotifyObject( Object )
{
Copy( Object ) ;
}
CInformationObject::~CInformationObject(void)
{
m_Message = 0 ;
m_InformationMessage = _T("") ;
}
CInformationObject & CInformationObject::operator = ( const CInformationObject & Object )
{
Copy( Object ) ;
return *this ;
}
LPCTSTR CInformationObject::get_InformationMessage()
{
return m_InformationMessage ;
}
void CInformationObject::Copy( const CInformationObject & Object )
{
m_InformationMessage = const_cast<CInformationObject&>(Object).m_InformationMessage ;
CNotifyObject::Copy(Object) ;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.