【VC开源代码栏目提醒】:网学会员VC开源代码为您提供Ex13_01ActiveXCtl.cpp参考,解决您在Ex13_01ActiveXCtl.cpp学习中工作中的难题,参考学习。
// Ex13_01ActiveXCtl.cpp : Implementation of the CEx13_01ActiveXCtrl ActiveX Control class.
#include "stdafx.h"
#include "Ex13_01ActiveX.h"
#include "Ex13_01ActiveXCtl.h"
#include "Ex13_01ActiveXPpg.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CEx13_01ActiveXCtrl, COleControl)
/////////////////////////////////////////////////////////////////////////////
// Message map
BEGIN_MESSAGE_MAP(CEx13_01ActiveXCtrl, COleControl)
//{{AFX_MSG_MAP(CEx13_01ActiveXCtrl)
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_TIMER()
//}}AFX_MSG_MAP
ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Dispatch map
BEGIN_DISPATCH_MAP(CEx13_01ActiveXCtrl, COleControl)
//{{AFX_DISPATCH_MAP(CEx13_01ActiveXCtrl)
DISP_PROPERTY_NOTIFY(CEx13_01ActiveXCtrl, "selectDispNumClock", m_selectDispNumClock, OnSelectDispNumClockChanged, VT_BOOL)
DISP_FUNCTION(CEx13_01ActiveXCtrl, "SetTime", SetTime, VT_EMPTY, VTS_I4 VTS_I4 VTS_I4)
DISP_STOCKFUNC_DOCLICK()
DISP_STOCKPROP_BACKCOLOR()
DISP_STOCKPROP_FORECOLOR()
DISP_STOCKPROP_FONT()
//}}AFX_DISPATCH_MAP
DISP_FUNCTION_ID(CEx13_01ActiveXCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
END_DISPATCH_MAP()
/////////////////////////////////////////////////////////////////////////////
// Event map
BEGIN_EVENT_MAP(CEx13_01ActiveXCtrl, COleControl)
//{{AFX_EVENT_MAP(CEx13_01ActiveXCtrl)
EVENT_CUSTOM("IsTime", FireIsTime, VTS_NONE)
EVENT_STOCK_CLICK()
//}}AFX_EVENT_MAP
END_EVENT_MAP()
/////////////////////////////////////////////////////////////////////////////
// Property pages
// TODO: Add more property pages as needed. Remember to increase the count!
BEGIN_PROPPAGEIDS(CEx13_01ActiveXCtrl, 4)
PROPPAGEID(CEx13_01ActiveXPropPage::guid)
PROPPAGEID(CLSID_CColorPropPage)
PROPPAGEID(CLSID_CFontPropPage)
PROPPAGEID(CLSID_CPicturePropPage)
END_PROPPAGEIDS(CEx13_01ActiveXCtrl)
/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CEx13_01ActiveXCtrl, "EX1301ACTIVEX.Ex1301ActiveXCtrl.1",
0x94f8d8f2, 0xabd5, 0x481d, 0xaa, 0x8f, 0xfc, 0xe0, 0xd0, 0xe7, 0x22, 0xb1)
/////////////////////////////////////////////////////////////////////////////
// Type library ID and version
IMPLEMENT_OLETYPELIB(CEx13_01ActiveXCtrl, _tlid, _wVerMajor, _wVerMinor)
/////////////////////////////////////////////////////////////////////////////
// Interface IDs
const IID BASED_CODE IID_DEx13_01ActiveX =
{ 0xddaa2850, 0xdefb, 0x483c, { 0xb9, 0x32, 0xb6, 0x8b, 0x78, 0xe0, 0x92, 0x25 } };
const IID BASED_CODE IID_DEx13_01ActiveXEvents =
{ 0x1e355ee, 0x78f4, 0x4d0d, { 0x81, 0xba, 0x73, 0xe, 0xcb, 0x7b, 0xd2, 0xd4 } };
/////////////////////////////////////////////////////////////////////////////
// Control type information
static const DWORD BASED_CODE _dwEx13_01ActiveXOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
OLEMISC_CANTLINKINSIDE |
OLEMISC_RECOMPOSEONRESIZE;
IMPLEMENT_OLECTLTYPE(CEx13_01ActiveXCtrl, IDS_EX13_01ACTIVEX, _dwEx13_01ActiveXOleMisc)
/////////////////////////////////////////////////////////////////////////////
// CEx13_01ActiveXCtrl::CEx13_01ActiveXCtrlFactory::UpdateRegistry -
// Adds or removes system registry entries for CEx13_01ActiveXCtrl
BOOL CEx13_01ActiveXCtrl::CEx13_01ActiveXCtrlFactory::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_EX13_01ACTIVEX,
IDB_EX13_01ACTIVEX,
afxRegApartmentThreading,
_dwEx13_01ActiveXOleMisc,
_tlid,
_wVerMajor,
_wVerMi