【VC开源代码栏目提醒】:本文主要为网学会员提供AutoServerDoc.cpp,希望对需要AutoServerDoc.cpp网友有所帮助,学习一下!
// AutoServerDoc.cpp : implementation of the CAutoServerDoc class
//
#include "stdafx.h"
#include "AutoServer.h"
#include "AutoServerDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAutoServerDoc
IMPLEMENT_DYNCREATE(CAutoServerDoc, CDocument)
BEGIN_MESSAGE_MAP(CAutoServerDoc, CDocument)
//{{AFX_MSG_MAP(CAutoServerDoc)
// 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()
BEGIN_DISPATCH_MAP(CAutoServerDoc, CDocument)
//{{AFX_DISPATCH_MAP(CAutoServerDoc)
DISP_PROPERTY_EX(CAutoServerDoc, "FillColor", GetFillColor, SetFillColor, VT_I4)
DISP_FUNCTION(CAutoServerDoc, "ShowServerWindow", ShowServerWindow, VT_EMPTY, VTS_NONE)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IAutoServer to support typesafe binding
// from
VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {3722EC84-9DDB-11D2-8103-C47F6A784D07}
static const IID IID_IAutoServer =
{ 0x3722ec84, 0x9ddb, 0x11d2, { 0x81, 0x3, 0xc4, 0x7f, 0x6a, 0x78, 0x4d, 0x7 } };
BEGIN_INTERFACE_MAP(CAutoServerDoc, CDocument)
INTERFACE_PART(CAutoServerDoc, IID_IAutoServer, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAutoServerDoc construction/destruction
CAutoServerDoc::CAutoServerDoc()
{
// TODO: add one-time construction code here
m_nFillColor=RGB(0,0,0);
EnableAutomation();
AfxOleLockApp();
}
CAutoServerDoc::~CAutoServerDoc()
{
AfxOleUnlockApp();
}
BOOL CAutoServerDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAutoServerDoc serialization
void CAutoServerDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CAutoServerDoc diagnostics
#ifdef _DEBUG
void CAutoServerDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CAutoServerDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAutoServerDoc commands
long CAutoServerDoc::GetFillColor()
{
// TODO: Add your property handler here
return m_nFillColor;
}
void CAutoServerDoc::SetFillColor(long nNewValue)
{
// TODO: Add your property handler here
m_nFillColor=nNewValue;
UpdateAllViews(NULL);
SetModifiedFlag();
}
void CAutoServerDoc::ShowServerWindow()
{
// TODO: Add your dispatch handler code here
CFrameWnd* pWnd=(CFrameWnd*) AfxGetMainWnd();
pWnd->ActivateFrame(SW_SHOW);
}