Click here to Skip to main content
15,881,248 members
Articles / Desktop Programming / ATL

Create a Universal Document Template which supports Dynamic Frame Window Layout

Rate me:
Please Sign up or sign in to vote.
3.00/5 (8 votes)
14 Dec 20024 min read 49.2K   668   24  
Introduce a programming technology to design a very complex, rich document type.
// VisualFrameWorkDoc.cpp : implementation of the CVisualFrameWorkDoc class
//

#include "stdafx.h"
#include "VisualFrameWork.h"
#include "VisualFrameWorkDataObj.h"
#include "MainFrm.h"

#include "VisualFrameWorkDoc.h"
#include "documentctrl.h"
#include "application.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CVisualFrameWorkDoc

IMPLEMENT_DYNCREATE(CVisualFrameWorkDoc, CTangramDoc)

BEGIN_MESSAGE_MAP(CVisualFrameWorkDoc, CTangramDoc)
END_MESSAGE_MAP()


// CVisualFrameWorkDoc construction/destruction

CVisualFrameWorkDoc::CVisualFrameWorkDoc()
{
	// TODO: add one-time construction code here
}

CVisualFrameWorkDoc::~CVisualFrameWorkDoc()
{
}

BOOL CVisualFrameWorkDoc::OnNewDocument()
{
	if (!CTangramDoc::OnNewDocument())
		return FALSE;

	return TRUE;
}

// CVisualFrameWorkDoc command

BOOL CVisualFrameWorkDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
	USES_CONVERSION;
	//////////////////$tangramapp$////////////////////////////
	if (!CTangramDoc::OnOpenDocument(lpszPathName))
		return FALSE;

	// TODO:  add your special create code.
	if(m_bMainDoc)
	{
		if(hBackBmp)
			((CMainFrame*)theApp.m_pMainWnd)->m_pObj->SetBitmap(hBackBmp);
		((CMainFrame*)theApp.m_pMainWnd)->SetWindowText(OLE2T(m_pDocument->m_bstrCaption));
	}
	m_pDocument->Fire_OpenDoc();
	//////////////////$tangramapp end$////////////////////////////
	return TRUE;
}
// CVisualFrameWorkDoc serialization

void CVisualFrameWorkDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
	CTangramDoc::Serialize(ar);
}


// CVisualFrameWorkDoc diagnostics

#ifdef _DEBUG
void CVisualFrameWorkDoc::AssertValid() const
{
	CTangramDoc::AssertValid();
}

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


// CVisualFrameWorkDoc commands

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


Written By
Web Developer
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions