Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Create a Universal Document Template which supports Dynamic Frame Window Layout

, 14 Dec 2002
Introduce a programming technology to design a very complex, rich document type.
visualframework_src.zip
sample
ObjManager
res
ObjManager.manifest
VisualFrameWork
application.rgs
AtlForm.rgs
Board.rgs
DocumentCtrl.rgs
Documents.rgs
menuimg.bmp
Prairie Wind.bmp
res
Toolbar.bmp
VisualFrameWork.ico
VisualFrameWork.manifest
VisualFrameWorkDoc.ico
VisualFrameWork.rgs
VisualFrameWork.tlb
VisualFrameWork1
VisualFrameWork12
VisualFrameWork13
Demo1
Demo2
MfcViewLib
MfcViewLib.rgs
cnn.rgs
MfcViewLib.def
MfcViewLibps.def
AtlView2.rgs
AtlView3.rgs
vc70.tlb
VbComLib
VbComLib.vbproj.user
VCSharpComLib
VCSharpComLib.csproj.user
DemoDoc
Demo1
Demo2
Demo3
DocumentPropertyPage.rgs
New Document 2
New Document333
New Document 2dd
VBDoc
UD.dob
prjVBDoc.vbp
MSSCCPRJ.SCC
prjVBDoc.vbw
CNN
MSSCCPRJ.SCC
PrjCnn.vbw
PrjCnn.dll
PrjCnn.lib
PrjCnn.exp
cls.cls
PrjCnn.vbp
//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// This source code is a part of Tangram library.
// You may use, compile or redistribute it as part of your application 
// for free. You cannot redistribute it as a part of a software development 
// library without the agreement of the author. If the sources are 
// distributed along with the application, you should leave the original 
// copyright notes in the source code without any changes.
// This code can be used WITHOUT ANY WARRANTIES on your own risk.
// 
// For the latest updates to this library, check site:
// http://www.tangramdev.com
// 
// sunhui
//*******************************************************************************
// Board.h : Declaration of the CTangramWindow

#ifndef __BOARD_H_
#define __BOARD_H_

#include "resource.h"       // main symbols
#include "TabWnd.h"
/////////////////////////////////////////////////////////////////////////////
// CTangramWindow
class ATL_NO_VTABLE CTangramWindow : public CTangramWindowObj,
	public CComObjectRootEx<CComSingleThreadModel>,
	public CStockPropImpl<CTangramWindow, ITangramWindow, &__uuidof(ITangramWindow), &LIBID_VisualFrameWorkLib>,
	public CComControl<CTangramWindow>,
	public IPersistStreamInitImpl<CTangramWindow>,
	public IOleControlImpl<CTangramWindow>,
	public IOleObjectImpl<CTangramWindow>,
	public IViewObjectExImpl<CTangramWindow>,
	public IOleInPlaceObjectWindowlessImpl<CTangramWindow>,
	public IPersistStorageImpl<CTangramWindow>,
	public ISpecifyPropertyPagesImpl<CTangramWindow>,
	public IQuickActivateImpl<CTangramWindow>,
	public CComCoClass<CTangramWindow, &CLSID_TangramWindow>
{
public:
	CTangramWindow()
	{
		((CDocCntrItem*)m_pOleItem)->m_pTangramWindow = this;
		m_pPicture = NULL;
	}

DECLARE_REGISTRY_RESOURCEID(IDR_TangramWindow)
DECLARE_NOT_AGGREGATABLE(CTangramWindow)

DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(CTangramWindow)
	COM_INTERFACE_ENTRY(ITangramWindow)
	COM_INTERFACE_ENTRY(IDispatch)
	COM_INTERFACE_ENTRY(IViewObjectEx)
	COM_INTERFACE_ENTRY(IViewObject2)
	COM_INTERFACE_ENTRY(IViewObject)
	COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
	COM_INTERFACE_ENTRY(IOleInPlaceObject)
	COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
	COM_INTERFACE_ENTRY(IOleControl)
	COM_INTERFACE_ENTRY(IOleObject)
	COM_INTERFACE_ENTRY(IPersistStreamInit)
	COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
	COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
	COM_INTERFACE_ENTRY(IQuickActivate)
	COM_INTERFACE_ENTRY(IPersistStorage)
END_COM_MAP()

BEGIN_PROP_MAP(CTangramWindow)
	PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
	PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
	//PROP_ENTRY("Caption", DISPID_CAPTION, CLSID_NULL)
	//PROP_ENTRY("Enabled", DISPID_ENABLED, CLSID_NULL)
	//PROP_ENTRY("Font", DISPID_FONT, CLSID_StockFontPage)
	//PROP_ENTRY("MouseIcon", DISPID_MOUSEICON, CLSID_StockPicturePage)
	//PROP_ENTRY("MousePointer", DISPID_MOUSEPOINTER, CLSID_NULL)
	PROP_ENTRY("Picture", DISPID_PICTURE, CLSID_StockPicturePage)
	//PROP_ENTRY("Text", DISPID_TEXT, CLSID_NULL)
	// Example entries
	// PROP_ENTRY("Property Description", dispid, clsid)
	// PROP_PAGE(CLSID_StockColorPage)
END_PROP_MAP()

BEGIN_MSG_MAP(CTangramWindow)
	CHAIN_MSG_MAP(CComControl<CTangramWindow>)
	DEFAULT_REFLECTION_HANDLER()
END_MSG_MAP()
// Handler prototypes:
//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);

// ITangramWindow
public:
	virtual HBITMAP GetBitmap();
	//CComBSTR m_bstrCaption;
	//BOOL m_bEnabled;
	//CComPtr<IFontDisp> m_pFont;
	//CComPtr<IPictureDisp> m_pMouseIcon;
	CComPtr<IPictureDisp> m_pPicture;
	//LONG m_nMousePointer;
	//CComBSTR m_bstrText;
};
OBJECT_ENTRY_AUTO(__uuidof(TangramWindow), CTangramWindow)

#endif //__BOARD_H_

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 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

Share

About the Author

dean170
Web Developer
China China
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140921.1 | Last Updated 15 Dec 2002
Article Copyright 2002 by dean170
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid