【VC开源代码栏目提醒】:网学会员为需要VC开源代码的朋友们搜集整理了GraphViewCtl.cpp相关资料,希望对各位网友有所帮助!
// GraphViewCtl.cpp : Implementation of the CGraphViewCtrl ActiveX Control class.
#include "stdafx.h"
#include "GraphView.h"
#include "GraphViewCtl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CGraphViewCtrl, COleControl)
/////////////////////////////////////////////////////////////////////////////
// Message map
BEGIN_MESSAGE_MAP(CGraphViewCtrl, COleControl)
//{{AFX_MSG_MAP(CGraphViewCtrl)
// 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(CGraphViewCtrl, COleControl)
//{{AFX_DISPATCH_MAP(CGraphViewCtrl)
DISP_PROPERTY_NOTIFY(CGraphViewCtrl, "ForeColor", m_foreColor, OnForeColorChanged, VT_COLOR)
DISP_PROPERTY_NOTIFY(CGraphViewCtrl, "LineType", m_lineType, OnLineTypeChanged, VT_I4)
DISP_PROPERTY_NOTIFY(CGraphViewCtrl, "LineWidth", m_lineWidth, OnLineWidthChanged, VT_I4)
DISP_PROPERTY_NOTIFY(CGraphViewCtrl, "BackColor", m_backColor, OnBackColorChanged, VT_COLOR)
DISP_FUNCTION(CGraphViewCtrl, "Clear", Clear, VT_EMPTY, VTS_NONE)
DISP_FUNCTION(CGraphViewCtrl, "SetScale", SetScale, VT_EMPTY, VTS_R8 VTS_R8 VTS_R8 VTS_R8)
DISP_FUNCTION(CGraphViewCtrl, "LineTo", LineTo, VT_EMPTY, VTS_R8 VTS_R8)
DISP_FUNCTION(CGraphViewCtrl, "MoveTo", MoveTo, VT_EMPTY, VTS_R8 VTS_R8)
DISP_FUNCTION(CGraphViewCtrl, "Multiline", Multiline, VT_EMPTY, VTS_I4 VTS_PR8 VTS_PR8)
DISP_FUNCTION(CGraphViewCtrl, "DrawLine", DrawLine, VT_EMPTY, VTS_R8 VTS_R8 VTS_R8 VTS_R8)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
/////////////////////////////////////////////////////////////////////////////
// Event map
BEGIN_EVENT_MAP(CGraphViewCtrl, COleControl)
//{{AFX_EVENT_MAP(CGraphViewCtrl)
// 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()
/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CGraphViewCtrl, "GRAPHVIEW.GraphViewCtrl.1",
0x37573b5e, 0x2a9a, 0x4686, 0x9c, 0xb7, 0x8d, 0x26, 0x11, 0xc4, 0x92, 0x72)
/////////////////////////////////////////////////////////////////////////////
// Type library ID and version
IMPLEMENT_OLETYPELIB(CGraphViewCtrl, _tlid, _wVerMajor, _wVerMinor)
/////////////////////////////////////////////////////////////////////////////
// Interface IDs
const IID BASED_CODE IID_DGraphView =
{ 0xb2c79461, 0x51b8, 0x4eeb, { 0x8e, 0x89, 0x8b, 0xf8, 0xdc, 0x83, 0xda, 0x60 } };
const IID BASED_CODE IID_DGraphViewEvents =
{ 0x2e5c7806, 0x20f7, 0x493a, { 0xad, 0x4c, 0xfd, 0xf6, 0xb7, 0xb0, 0x25, 0xd4 } };
/////////////////////////////////////////////////////////////////////////////
// Control type information
static const DWORD BASED_CODE _dwGraphViewOleMisc =
OLEMISC_ACTIVATEWHENVISIBLE |
OLEMISC_SETCLIENTSITEFIRST |
OLEMISC_INSIDEOUT |
OLEMISC_CANTLINKINSIDE |
OLEMISC_RECOMPOSEONRESIZE;
IMPLEMENT_OLECTLTYPE(CGraphViewCtrl, IDS_GRAPHVIEW, _dwGraphViewOleMisc)
/////////////////////////////////////////////////////////////////////////////
// CGraphViewCtrl::CGraphViewCtrlFactory::UpdateRegistry -
// Adds or removes system registry entries for CGraphViewCtrl
BOOL CGraphViewCtrl::CGraphViewCtrlFactory::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_GRAPHVIEW,
IDB_GRAPHVIEW,
afxRegApartmentThreading,
_dwGraphViewOleMisc,
_tlid,
_wVerMajor,
_wVerMinor);
else
return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
}
////////////////////////////