📄 classicatldicesvrctl.cpp
字号:
// ClassicATLdiceSvrCtl.cpp : Implementation of the CClassicATLdiceSvrCtrl ActiveX Control class.
#include "stdafx.h"
#include "ClassicATLdiceSvr.h"
#include "ClassicATLdiceSvrCtl.h"
#include "ClassicATLdiceSvrPpg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CClassicATLdiceSvrCtrl, COleControl)
/////////////////////////////////////////////////////////////////////////////
// Message map
BEGIN_MESSAGE_MAP(CClassicATLdiceSvrCtrl, COleControl)
//{{AFX_MSG_MAP(CClassicATLdiceSvrCtrl)
// NOTE - ClassWizard will add and remove message map entries
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Dispatch map
BEGIN_DISPATCH_MAP(CClassicATLdiceSvrCtrl, COleControl)
//{{AFX_DISPATCH_MAP(CClassicATLdiceSvrCtrl)
// NOTE - ClassWizard will add and remove dispatch map entries
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
/////////////////////////////////////////////////////////////////////////////
// Event map
BEGIN_EVENT_MAP(CClassicATLdiceSvrCtrl, COleControl)
//{{AFX_EVENT_MAP(CClassicATLdiceSvrCtrl)
// NOTE - ClassWizard will add and remove event map entries
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_EVENT_MAP
END_EVENT_MAP()
/////////////////////////////////////////////////////////////////////////////
// Property pages
// TODO: Add more property pages as needed. Remember to increase the count!
BEGIN_PROPPAGEIDS(CClassicATLdiceSvrCtrl, 1)
PROPPAGEID(CClassicATLdiceSvrPropPage::guid)
END_PROPPAGEIDS(CClassicATLdiceSvrCtrl)
/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CClassicATLdiceSvrCtrl, "CLASSICATLDICESVR.ClassicATLdiceSvrCtrl.1",
0x4e7fe59a, 0xee5, 0x417b, 0x87, 0x82, 0xd5, 0x26, 0x1e, 0x6a, 0x48, 0x63)
/////////////////////////////////////////////////////////////////////////////
// Type library ID and version
IMPLEMENT_OLETYPELIB(CClassicATLdiceSvrCtrl, _tlid, _wVerMajor, _wVerMinor)
/////////////////////////////////////////////////////////////////////////////
// Interface IDs
const IID BASED_CODE IID_DClassicATLdiceSvr =
{ 0x4b0baa9b, 0xe424, 0x4f53, { 0x9f, 0x65, 0x57, 0x81, 0x87, 0xb5, 0x75, 0x7 } };
const IID BASED_CODE IID_DClassicATLdiceSvrEvents =
{ 0x96953a9e, 0x4e2, 0x4eac, { 0x83, 0xe0, 0xb7, 0x93, 0x85, 0xb6, 0xbe, 0xd8 } };
/////////////////////////////////////////////////////////////////////////////
// Control type information
static const DWORD BASED_CODE _dwClassicATLdiceSvrOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
OLEMISC_CANTLINKINSIDE |
OLEMISC_RECOMPOSEONRESIZE;
IMPLEMENT_OLECTLTYPE(CClassicATLdiceSvrCtrl, IDS_CLASSICATLDICESVR, _dwClassicATLdiceSvrOleMisc)
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::CClassicATLdiceSvrCtrlFactory::UpdateRegistry -
// Adds or removes system registry entries for CClassicATLdiceSvrCtrl
BOOL CClassicATLdiceSvrCtrl::CClassicATLdiceSvrCtrlFactory::UpdateRegistry(BOOL bRegister)
{
// TODO: Verify that your control follows apartment-model threading rules.
// Refer to MFC TechNote 64 for more information.
// If your control does not conform to the apartment-model rules, then
// you must modify the code below, changing the 6th parameter from
// afxRegApartmentThreading to 0.
if (bRegister)
return AfxOleRegisterControlClass(
AfxGetInstanceHandle(),
m_clsid,
m_lpszProgID,
IDS_CLASSICATLDICESVR,
IDB_CLASSICATLDICESVR,
afxRegApartmentThreading,
_dwClassicATLdiceSvrOleMisc,
_tlid,
_wVerMajor,
_wVerMinor);
else
return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
}
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::CClassicATLdiceSvrCtrl - Constructor
CClassicATLdiceSvrCtrl::CClassicATLdiceSvrCtrl()
{
InitializeIIDs(&IID_DClassicATLdiceSvr, &IID_DClassicATLdiceSvrEvents);
// TODO: Initialize your control's instance data here.
}
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::~CClassicATLdiceSvrCtrl - Destructor
CClassicATLdiceSvrCtrl::~CClassicATLdiceSvrCtrl()
{
// TODO: Cleanup your control's instance data here.
}
#include "Transparency.h"
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::OnDraw - Drawing function
void CClassicATLdiceSvrCtrl::OnDraw(
CDC* pDC, const CRect& rcBounds, const CRect& rcInvalid)
{
// TODO: Replace the following code with your own drawing code.
const COLORREF clrTransparency = RGB(255, 255, 255);
//int nBkModeOld = pDC->SetBkMode(TRANSPARENT);
// Load Bitmap
CBitmap bmp;
if (!bmp.LoadBitmap(IDB_SHOW))
return;
VERIFY(ShowTransparencyBitmap(pDC, 0, 0, &bmp, 0, 0, 0, 0, RGB(255, 255, 255)));
}
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::DoPropExchange - Persistence support
void CClassicATLdiceSvrCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
}
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl::OnResetState - Reset control to default state
void CClassicATLdiceSvrCtrl::OnResetState()
{
COleControl::OnResetState(); // Resets defaults found in DoPropExchange
// TODO: Reset any other control state here.
}
/////////////////////////////////////////////////////////////////////////////
// CClassicATLdiceSvrCtrl message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -