Click here to Skip to main content
15,885,244 members
Articles / Desktop Programming / MFC

Notifying the Document

Rate me:
Please Sign up or sign in to vote.
4.36/5 (11 votes)
12 Jul 2006CPOL6 min read 63.5K   1.2K   35  
An article on delivering objects to the document in a document/view architecture, using the WM_NOTIFY message.
// NotifierAppView.h : interface of the CNotifierAppView class
//
#pragma once


class CNotifierAppView : public CFormView
{
protected: // create from serialization only
	CNotifierAppView();
	DECLARE_DYNCREATE(CNotifierAppView)

public:
	enum{ IDD = IDD_NOTIFIERAPP_FORM };

// Attributes
public:
	CNotifierAppDoc* GetDocument() const;

// Operations
public:

// Overrides
	public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct

// Implementation
public:
	virtual ~CNotifierAppView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
	UINT_PTR m_Timer ; 
	BOOL m_bRunStop ;
	CListCtrl m_List;

// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButtonRunstop();
protected:
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
public:
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnBnClickedButtonError();
};

#ifndef _DEBUG  // debug version in NotifierAppView.cpp
inline CNotifierAppDoc* CNotifierAppView::GetDocument() const
   { return reinterpret_cast<CNotifierAppDoc*>(m_pDocument); }
#endif

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)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions