⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bcgpoleserverdoc.cpp

📁 远程网络监视程序的源码
💻 CPP
字号:
//*******************************************************************************
// COPYRIGHT NOTES
// ---------------
// This is a part of the BCGControlBar Library
// Copyright (C) 1998-2003 BCGSoft Ltd.
// All rights reserved.
//
// This source code can be used, distributed or modified
// only under terms and conditions 
// of the accompanying license agreement.
//*******************************************************************************
// BCGPOleServerDoc.cpp : implementation file
//

#include "stdafx.h"
#include "bcgcbpro.h"
#include "BCGPOleServerDoc.h"
#include "BCGPOleDocIPFrameWnd.h"
#include "BCGPOleIPFrameWnd.h"
#include "BCGPOleCntrFrameWnd.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CBCGPOleServerDoc

IMPLEMENT_DYNCREATE(CBCGPOleServerDoc, COleServerDoc)

CBCGPOleServerDoc::CBCGPOleServerDoc()
{
}

BOOL CBCGPOleServerDoc::OnNewDocument()
{
	if (!COleServerDoc::OnNewDocument())
		return FALSE;
	return TRUE;
}

CBCGPOleServerDoc::~CBCGPOleServerDoc()
{
}

COleServerItem* CBCGPOleServerDoc::OnGetEmbeddedItem()
{
	// OnGetEmbeddedItem is called by the framework to get the COleServerItem
	//  that is associated with the document.  It is only called when necessary.

	// Instead of returning NULL, return a pointer to a new COleServerItem
	//  derived class that is used in conjunction with this document, then
	//  remove the ASSERT(FALSE) below.
	//  (i.e., return new CMyServerItem.)
	ASSERT(FALSE);			// remove this after completing the TODO
	return NULL;
}


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

/////////////////////////////////////////////////////////////////////////////
// CBCGPOleServerDoc diagnostics

#ifdef _DEBUG
void CBCGPOleServerDoc::AssertValid() const
{
	COleServerDoc::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// CBCGPOleServerDoc serialization

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

/////////////////////////////////////////////////////////////////////////////
// CBCGPOleServerDoc commands
void CBCGPOleServerDoc::OnResizeBorder( LPCRECT lpRectBorder, LPOLEINPLACEUIWINDOW lpUIWindow, BOOL bFrame )
{

	ASSERT_VALID(this);
	ASSERT(lpUIWindow != NULL);

	
	if(!bFrame)
	{
		COleServerDoc::OnResizeBorder(lpRectBorder, lpUIWindow, bFrame);

		return;
	}

	CBCGPOleCntrFrameWnd* pMainFrame = NULL;

	CBCGPOleDocIPFrameWnd* p_IpDocFrame = 
						DYNAMIC_DOWNCAST(CBCGPOleDocIPFrameWnd, m_pInPlaceFrame);

	if(p_IpDocFrame != NULL)
	{

		pMainFrame =  p_IpDocFrame->GetContainerFrameWindow();

		
	}else
	{
		CBCGPOleIPFrameWnd* p_IpFrame = 
						DYNAMIC_DOWNCAST(CBCGPOleIPFrameWnd, m_pInPlaceFrame);

		if(p_IpFrame != NULL)
		{
			pMainFrame =  p_IpFrame->GetContainerFrameWindow();

		}else
		{
			return;
		}
		
	}


	
	if(pMainFrame == NULL)
	{
		return;
	}

	CBCGPDockManager* pDockManager = pMainFrame->GetDockManager ();

	pDockManager->AdjustDockingLayout ();

	CRect rectClient = pDockManager->GetClientAreaBounds ();


	CRect rcCurBorders;

		if(lpUIWindow->GetBorder(&rcCurBorders) != S_OK)
		{
			lpUIWindow->SetBorderSpace(NULL);
			return;
		}

		CRect rcBorders(
			abs(rectClient.left - rcCurBorders.left),
			abs(rectClient.top - rcCurBorders.top),
			abs(rectClient.right - rcCurBorders.right),
			abs(rectClient.bottom  - rcCurBorders.bottom )-1);


		
			if(lpUIWindow->RequestBorderSpace(&rcBorders)== S_OK)
			{
				lpUIWindow->SetBorderSpace(&rcBorders);
				
			}else
			{
				CRect rect(0,0,0,0);
				lpUIWindow->SetBorderSpace(&rcBorders);
		
			}


			pDockManager->AdjustDockingLayout();
			pDockManager->ShowControlBars(TRUE);




}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -