Click here to Skip to main content
12,402,889 members (75,004 online)
Click here to Skip to main content

Stats

46.3K views
970 downloads
33 bookmarked
Posted

Notifying the Document

, 12 Jul 2006 CPOL
An article on delivering objects to the document in a document/view architecture, using the WM_NOTIFY message.
#pragma once

#define NOTIFY_ERROR_SCHEMA 100 


class CErrorObject : public CNotifyObject
{
	DECLARE_SERIAL(CErrorObject) 
protected:
	CErrorObject() {}
public:
	CErrorObject( UINT Message, LPCTSTR ErrorMessage, NMHDR & Hdr );
	CErrorObject( const CErrorObject & Object );
	virtual ~CErrorObject(void);

	CErrorObject & operator = ( const CErrorObject & Object ) ;

	LPCTSTR get_ErrorMessage() ; 

protected:
	void Copy( const CErrorObject & Object ) ; 

protected:
	CString m_ErrorMessage ; 


};

#define NOTIFY_INFORMATION_SCHEMA 100 


class CInformationObject : public CNotifyObject
{
	DECLARE_SERIAL(CInformationObject) 
protected:
	CInformationObject() {}
public:
	CInformationObject( UINT Message, LPCTSTR InformationMessage, NMHDR & Hdr );
	CInformationObject( const CInformationObject & Object );
	virtual ~CInformationObject(void);

	CInformationObject & operator = ( const CInformationObject & Object ) ;

	LPCTSTR get_InformationMessage() ; 

protected:
	void Copy( const CInformationObject & Object ) ; 

protected:
	CString m_InformationMessage ; 


};


enum
{
	NOTIFY_INVALID_OBJECT=-1,
	NOTIFY_ERROR_OBJECT=0,
	NOTIFY_INFORMATION_OBJECT,
	NOTIFY_OBJECT_COUNT
} ;

class NotifyObjectType
{
public:
	NotifyObjectType( CNotifyObject * pObject ) ;
	operator long() ; 
protected:
	long m_Type ; 
} ;


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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Michael Bergman
Software Developer (Senior)
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160721.1 | Last Updated 12 Jul 2006
Article Copyright 2006 by Michael Bergman
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid