Click here to Skip to main content
12,243,354 members (50,139 online)
Click here to Skip to main content

Stats

41.8K views
561 downloads
24 bookmarked
Posted

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.
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
// AtlForm.cpp : Implementation of CAtlForm

#include "stdafx.h"
#include "VisualFrameWork.h"
#include "AtlForm.h"


// CAtlForm


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

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

/////////////////////////////////////////////////////////////////////////////
// TestFormView

IMPLEMENT_DYNCREATE(TestFormView, CFormView)

TestFormView::TestFormView()
	: CFormView(TestFormView::IDD)
{
	//{{AFX_DATA_INIT(TestFormView)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	bHooked = false;
	m_pComObj = new CComObject<CAtlForm>;
	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_AtlForm;
		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;
}

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

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


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

/////////////////////////////////////////////////////////////////////////////
// TestFormView diagnostics

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

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

/////////////////////////////////////////////////////////////////////////////
// TestFormView message handlers
BOOL TestFormView::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 TestFormView::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;
	}
	//LoadFromResource(IDR_HTML1);
}

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

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160426.1 | Last Updated 15 Dec 2002
Article Copyright 2002 by dean170
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid