Click here to Skip to main content
14,219,126 members

Customized Visual Studio .NET package: your fully integrated document window inside the IDE

Rate this:
4.72 (20 votes)
Please Sign up or sign in to vote.
4.72 (20 votes)
20 Dec 2003
Create a fully integrated document window inside the Visual Studio IDE.
- File Name: Mediator.h
- Date: 12/9/2003 5:19:00 PM
- Author: Michael Sheinin
- Description : 
	The declaration of the CMediator class. This class is intended to decouple
	CDocumentData, CDocumentView and CWindow objects.
- Notes: 
	1.This class/object is resposible for the window creation and destruction.
	2.Obviously this class is NOT thread-safe if document and data objects are
	  ussue requests to an object of this class in contexts of different threads.
#pragma once

class CDocumentData;
class CDocumentView;
class CGraphicObject;

	class CVsBasicWnd;
	class	CMyWindow;
#endif // _BASIC_WINDOW_

class CMediator
	void	SetData(CDocumentData* pData);
	void	SetView(CDocumentView* pView );
	////// Document View ///////////
	HWND	CreateWnd(HWND hParent, int iX, int iY, int iCX, int iCY );
	void	CloseWindow();
	DWORD	QueryCommandsState();
	HRESULT	ExecCommand(ULONG uCmdID);
	////// Document Data ////////////
	void	AddGraphicObject( CGraphicObject* pObj );	
	void	UpdateView();
	////// Window ///////////////////	

	// the object cannot be destroyed explicitly (and cannot be declared on program stack).
	void AddRef(void);
	void Release(void);
	ULONG			m_uRefCnt;
	CDocumentData*	m_pData;
	CDocumentView*	m_pView;
	CVsBasicWnd*		m_pWnd;
	CMyWindow*		m_pWnd;
#endif // _BASIC_WINDOW_


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 article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Michael Sheinin
Web Developer
United States United States
For the last 7 years I have developed software in real-time/embedded and MS-Windows environments for military and civil markets. I hold B.Sc. degree in computer engineering. Living in Ontario, Canada, I like hiking and traveling in general. Currently, I'm looking for employment opportunity inside the GTA.


39 bookmarked