?? axserverdoc.cpp
字號:
// AxServerDoc.cpp : implementation of the CAxServerDoc class
//
#include "stdafx.h"
#include "AxServer.h"
#include "AxServerDoc.h"
#include "AxServerView.h"
#include "SrvrItem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc
IMPLEMENT_DYNCREATE(CAxServerDoc, COleServerDoc)
BEGIN_MESSAGE_MAP(CAxServerDoc, COleServerDoc)
//{{AFX_MSG_MAP(CAxServerDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc construction/destruction
CLIPFORMAT NEAR CAxServerDoc::m_cfPrivate = NULL;
CAxServerDoc::CAxServerDoc()
{
// Use OLE compound files
EnableCompoundFile();
// TODO: add one-time construction code here
if (m_cfPrivate == NULL)
{
m_cfPrivate = (CLIPFORMAT)
::RegisterClipboardFormat(_T("ActiveX服務器實例"));
}
}
CAxServerDoc::~CAxServerDoc()
{
}
BOOL CAxServerDoc::OnNewDocument()
{
if (!COleServerDoc::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc server implementation
COleServerItem* CAxServerDoc::OnGetEmbeddedItem()
{
// OnGetEmbeddedItem is called by the framework to get the COleServerItem
// that is associated with the document. It is only called when necessary.
CAxServerSrvrItem* pItem = new CAxServerSrvrItem(this);
ASSERT_VALID(pItem);
return pItem;
}
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc serialization
void CAxServerDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc diagnostics
#ifdef _DEBUG
void CAxServerDoc::AssertValid() const
{
COleServerDoc::AssertValid();
}
void CAxServerDoc::Dump(CDumpContext& dc) const
{
COleServerDoc::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAxServerDoc commands
COleServerItem* CAxServerDoc::OnGetLinkedItem(LPCTSTR lpszItemName)
{
// TODO: Add your specialized code here and/or call the base class
COleServerItem* pItem=COleServerDoc::OnGetLinkedItem(lpszItemName);
if(pItem!=NULL)
return pItem;
else
{
// 添加自己的搜索代碼
return pItem;
}
}
void CAxServerDoc::OnSetItemRects(LPCRECT lpPosRect, LPCRECT lpClipRect)
{
// TODO: Add your specialized code here and/or call the base class
// 得到與當前文檔相關聯的第一個視
POSITION pos = GetFirstViewPosition();
ASSERT(pos != NULL);
CAxServerView* pView = (CAxServerView*)GetNextView(pos);
ASSERT_KINDOF(CAxServerView, pView);
ASSERT_VALID(pView);
// 得到視的設備情景對象
CClientDC dc(pView);
// 設置縮放比例為100%
dc.SetViewportExt(CSize(1,1));
dc.SetWindowExt(CSize(1,1));
// 重新設置編輯窗口大小
COleServerDoc::OnSetItemRects(lpPosRect, lpClipRect);
}
void CAxServerDoc::Draw(CDC* pDC)
{
pDC->Rectangle(10,10,100,100);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -