- emboleobjctrl_src.zip
- EmbOleObjCtrl
- emboleobjctrl_demo.zip
- AXSERVER
- AXSERVER.CLW
- AXSERVER.CPP
- AXSERVER.DSP
- AXSERVER.DSW
- AXSERVER.H
- AXSERVER.RC
- AXSERVER.REG
- AXSERVER.sln
- AxServer.vcproj
- AXSERVERDOC.CPP
- AXSERVERDOC.H
- AXSERVERVIEW.CPP
- AXSERVERVIEW.H
- CHILDFRM.CPP
- CHILDFRM.H
- IPFRAME.CPP
- IPFRAME.H
- MAINFRM.CPP
- MAINFRM.H
- README.TXT
- RES
- AXSERVER.ICO
- AXSERVER.RC2
- AXSERVERDOC.ICO
- ITOOLBAR.BMP
- TOOLBAR.BMP
- RESOURCE.H
- SRVRITEM.CPP
- SRVRITEM.H
- STDAFX.CPP
- STDAFX.H
- EmbOleObjCtrl
- EmbOleObjCtrl1.sln
- tester
|
// AxDocConView.cpp : implementation of the CAxDocConView class
//
#include "stdafx.h"
#include "AxDocConDoc.h"
#include "CntrItem.h"
#include "AxDocConView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include <comutil.h>
#include ".\axdocconview.h"
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView
IMPLEMENT_DYNCREATE(CAxDocConView, CView)
BEGIN_MESSAGE_MAP(CAxDocConView, CView)
//{{AFX_MSG_MAP(CAxDocConView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
ON_WM_DESTROY()
ON_WM_SETFOCUS()
ON_WM_SIZE()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView construction/destruction
CAxDocConView::CAxDocConView()
{
}
CAxDocConView::~CAxDocConView()
{
}
BOOL CAxDocConView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView drawing
void CAxDocConView::OnDraw(CDC* pDC)
{
CAxDocConDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CAxDocConView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: remove this code when final selection model code is written
//Active documents should always be activated
COleDocument* pDoc = (COleDocument*) GetDocument();
if (pDoc != NULL)
{
// activate the first one
POSITION posItem = pDoc->GetStartPosition();
if (posItem != NULL)
{
CDocItem* pItem = pDoc->GetNextItem(posItem);
// only if it's an Active document
COleDocObjectItem *pDocObjectItem =
DYNAMIC_DOWNCAST(COleDocObjectItem, pItem);
if (pDocObjectItem != NULL)
{
pDocObjectItem->DoVerb(OLEIVERB_SHOW, this);
}
}
}
}
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView printing
BOOL CAxDocConView::OnPreparePrinting(CPrintInfo* pInfo)
{
if (!CView::DoPreparePrinting(pInfo))
return FALSE;
if (!COleDocObjectItem::OnPreparePrinting(this, pInfo))
return FALSE;
return TRUE;
}
void CAxDocConView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CAxDocConView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
void CAxDocConView::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
// TODO: add customized printing code here
if(pInfo->m_bDocObject)
COleDocObjectItem::OnPrint(this, pInfo, TRUE);
else
CView::OnPrint(pDC, pInfo);
}
void CAxDocConView::OnDestroy()
{
// Deactivate the item on destruction; this is important
// when a splitter view is being used.
CView::OnDestroy();
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
{
pActiveItem->Deactivate();
ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
}
}
/////////////////////////////////////////////////////////////////////////////
// OLE Client support and commands
BOOL CAxDocConView::IsSelected(const CObject* pDocItem) const
{
// The implementation below is adequate if your selection consists of
// only CAxDocConCntrItem objects. To handle different selection
// mechanisms, the implementation here should be replaced.
// TODO: implement this function that tests for a selected OLE client item
return TRUE;
}
// Special handling of OnSetFocus and OnSize are required for a container
// when an object is being edited in-place.
void CAxDocConView::OnSetFocus(CWnd* pOldWnd)
{
//COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
//if (pActiveItem != NULL &&
// pActiveItem->GetItemState() == COleClientItem::activeUIState)
//{
// // need to set focus to this item if it is in the same view
// CWnd* pWnd = pActiveItem->GetInPlaceWindow();
// if (pWnd != NULL)
// {
// pWnd->SetFocus(); // don't call the base class
// return;
// }
//}
CView::OnSetFocus(pOldWnd);
}
void CAxDocConView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
if (pActiveItem != NULL)
pActiveItem->SetItemRects();
}
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView diagnostics
#ifdef _DEBUG
void CAxDocConView::AssertValid() const
{
CView::AssertValid();
}
void CAxDocConView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CAxDocConDoc* CAxDocConView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAxDocConDoc)));
return (CAxDocConDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAxDocConView message handlers
void CAxDocConView::OnLButtonDown(UINT nFlags, CPoint point)
{
CView::OnLButtonDown(nFlags, point);
}
BOOL CAxDocConView::OpenPDFDoc(const CString &strPath)
{
return FALSE;
}
|
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
My name is Wangwanxin, living in beijing,China.since spe,2002 till now,working as a windows software developer,be faimliar with c++/mfc,atl. devotional,faithful,... I'll devote more time here, I'd like to exchange my limited ideas here,open my heart, and then have the whole world.