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

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
// AtlView3.cpp : Implementation of CAtlView3

#include "stdafx.h"
#include "MfcViewLib.h"
#include "AtlView3.h"


// CAtlView3


STDMETHODIMP CAtlView3::get_Name(BSTR *pVal)
{
	// TODO: Add your implementation code here
	return m_pMfcWnd->m_pTangramObject->getAPCName(pVal);
}

STDMETHODIMP CAtlView3::put_Name(BSTR newVal)
{
	// TODO: Add your implementation code here
	return m_pMfcWnd->m_pTangramObject->putAPCName(newVal);
}

/////////////////////////////////////////////////////////////////////////////
// CShareFormView3

IMPLEMENT_DYNCREATE(CShareFormView3, CFormView)

CShareFormView3::CShareFormView3()
	: CFormView(CShareFormView3::IDD)
	, m_strEdit(_T(""))
{
	//{{AFX_DATA_INIT(CShareFormView3)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	bHooked = false;
	m_pComObj = new CComObject<CAtlView3>;
	m_pComObj->m_pMfcWnd = this;
	m_pTangramObj = g_pTangramServer->m_pCurTangramObj2;
	m_pTangramObject = g_pTangramServer->m_pCurTangramObj;
	if(m_pTangramObject)
	{
		m_pTangramObject->m_pDisp = m_pComObj;
		g_pTangramServer->m_pCurTangramObj=NULL;
	}
	else
	{
		m_pTangramObj->m_ObjClsID = CLSID_AtlView3;
		m_pTangramObj->bHooked=true;
		m_pTangramObj->m_pDisp=m_pComObj;

		g_pTangramServer->m_pCurTangramObj2=NULL;
		bHooked= true;
	}
	//m_pTangramObject = g_pTangramServer->m_pCurTangramObj;
	//g_pTangramServer->m_pCurTangramObj->m_pDisp = m_pComObj;
}

CShareFormView3::~CShareFormView3()
{
	if(!g_pTangramServer->m_bHook)
		if(m_pComObj)
		{
			//delete m_pComObj;
			//m_pComObj=NULL;
		}
}

void CShareFormView3::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CShareFormView3)
	// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
	DDX_Text(pDX, IDC_EDIT1, m_strEdit);
}


BEGIN_MESSAGE_MAP(CShareFormView3, CFormView)
	//{{AFX_MSG_MAP(CShareFormView3)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
	ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CShareFormView3 diagnostics

#ifdef _DEBUG
void CShareFormView3::AssertValid() const
{
	CFormView::AssertValid();
}

void CShareFormView3::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CShareFormView3 message handlers
BOOL CShareFormView3::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
	// TODO: Add your specialized code here and/or call the base class
	AfxSetResourceHandle(theApp.m_hInstance);
	return CFormView::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
void CShareFormView3::OnInitialUpdate() 
{
	//TODO: This code navigates to a popular spot on the web.
	//Change the code to go where you'd like.
	if(m_pTangramObject&&!m_pTangramObject->bDefineRegist)
	{
		if(!m_pTangramObject->isRegist)
		{
		}
		else
		{
		}
		m_pTangramObject->bDefineRegist=true;
	}
}

void CShareFormView3::OnBnClickedButton1()
{
	// TODO: Add your control notification handler code here
	AfxMessageBox(_T("I'm in Form 3"));
}

STDMETHODIMP CAtlView3::GetText(BSTR str)
{
	//AFX_MANAGE_STATE(AfxGetStaticModuleState());

	// TODO: Add your implementation code here
	m_pMfcWnd->m_strEdit=str;
	m_pMfcWnd->UpdateData(FALSE);
	return S_OK;
}

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
Web01 | 2.8.141022.1 | Last Updated 15 Dec 2002
Article Copyright 2002 by dean170
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid