ActiveX


MyCtrlCtl.cpp


// MyCtrlCtl.cpp : Implementation of the CMyCtrlCtrl ActiveX Control class.

 

#include "stdafx.h"

#include "MyCtrl.h"

#include "MyCtrlCtl.h"

#include "MyCtrlPpg.h"

 

 

#ifdef _DEBUG

#define new DEBUG_NEW

#undef THIS_FILE

static char THIS_FILE[] = __FILE__;

#endif

 

 

IMPLEMENT_DYNCREATE(CMyCtrlCtrl, COleControl)

 

 

/////////////////////////////////////////////////////////////////////////////

// Message map

 

BEGIN_MESSAGE_MAP(CMyCtrlCtrl, COleControl)

//{{AFX_MSG_MAP(CMyCtrlCtrl)

ON_WM_LBUTTONDOWN()

ON_WM_TIMER()

ON_WM_CREATE()

ON_WM_CLOSE()

//}}AFX_MSG_MAP

ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)

END_MESSAGE_MAP()

 

 

/////////////////////////////////////////////////////////////////////////////

// Dispatch map

 

BEGIN_DISPATCH_MAP(CMyCtrlCtrl, COleControl)

//{{AFX_DISPATCH_MAP(CMyCtrlCtrl)

DISP_PROPERTY_EX(CMyCtrlCtrl, "Shape", GetShape, SetShape, VT_I2)

DISP_PROPERTY_EX(CMyCtrlCtrl, "Selected", GetSelected, SetNotSupported, VT_BOOL)

DISP_PROPERTY_EX(CMyCtrlCtrl, "SelectColor", GetSelectColor, SetSelectColor, VT_COLOR)

DISP_PROPERTY_EX(CMyCtrlCtrl, "TextColor", GetTextColor, SetTextColor, VT_COLOR)

DISP_PROPERTY_EX(CMyCtrlCtrl, "Sleep", GetSleep, SetSleep, VT_I4)

DISP_FUNCTION(CMyCtrlCtrl, "DoChangeTimer", DoChangeTimer, VT_BOOL, VTS_NONE)

DISP_DEFVALUE(CMyCtrlCtrl, "Shape")

DISP_STOCKPROP_FORECOLOR()

DISP_STOCKPROP_CAPTION()

DISP_STOCKPROP_FONT()

//}}AFX_DISPATCH_MAP

DISP_FUNCTION_ID(CMyCtrlCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)

END_DISPATCH_MAP()

 

 

/////////////////////////////////////////////////////////////////////////////




- -  - -  - -