// RasterAnnSink.cpp : implementation file // #include "stdafx.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CRasterAnnSink IMPLEMENT_DYNCREATE(CRasterAnnSink, CCmdTarget) CRasterAnnSink::CRasterAnnSink() { EnableAutomation(); } CRasterAnnSink::~CRasterAnnSink() { } void CRasterAnnSink::OnFinalRelease() { // When the last reference for an automation object is released // OnFinalRelease is called. The base class will automatically // deletes the object. Add additional cleanup required for your // object before calling the base class. CCmdTarget::OnFinalRelease(); } BEGIN_MESSAGE_MAP(CRasterAnnSink, CCmdTarget) //{{AFX_MSG_MAP(CRasterAnnSink) // NOTE - the ClassWizard will add and remove mapping macros here. //}}AFX_MSG_MAP END_MESSAGE_MAP() BEGIN_DISPATCH_MAP(CRasterAnnSink, CCmdTarget) //{{AFX_DISPATCH_MAP(CRasterAnnSink) // NOTE - the ClassWizard will add and remove mapping macros here. DISP_FUNCTION_ID(CRasterAnnSink,"AnnCreate", 5,OnAnnCreate, VT_EMPTY,VTS_I4) DISP_FUNCTION_ID(CRasterAnnSink,"AnnClicked", 7,OnAnnClicked, VT_EMPTY,VTS_I4) DISP_FUNCTION_ID(CRasterAnnSink,"AnnDrawn", 8,OnAnnDrawn, VT_EMPTY,VTS_I4) DISP_FUNCTION_ID(CRasterAnnSink,"AnnToolDestroy",16,OnAnnToolDestroy,VT_EMPTY,VTS_NONE) DISP_FUNCTION_ID(CRasterAnnSink,"AnnToolChecked",17,OnAnnToolChecked,VT_EMPTY,VTS_I2) DISP_FUNCTION_ID(CRasterAnnSink,"AnnMouseDown", 18,OnAnnMouseDown, VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I4) DISP_FUNCTION_ID(CRasterAnnSink,"AnnMouseMove", 19,OnAnnMouseMove, VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I4) DISP_FUNCTION_ID(CRasterAnnSink,"AnnMouseUp", 20,OnAnnMouseUp, VT_EMPTY,VTS_I2 VTS_I2 VTS_I4 VTS_I4) //}}AFX_DISPATCH_MAP END_DISPATCH_MAP() // Note: we add support for IID_IRasterAnnSink to support typesafe binding // from VBA. This IID must match the GUID that is attached to the // dispinterface in the .ODL file. // {63C6825E-0F62-467F-863F-0958C2A488D9} static const IID IID_IRasterAnnSink = { 0x63c6825e, 0xf62, 0x467f, { 0x86, 0x3f, 0x9, 0x58, 0xc2, 0xa4, 0x88, 0xd9 } }; BEGIN_INTERFACE_MAP(CRasterAnnSink, CCmdTarget) INTERFACE_PART(CRasterAnnSink, DIID__LEADRasterAnnotationEvents, Dispatch) END_INTERFACE_MAP() ///////////////////////////////////////////////////////////////////////////// // CRasterAnnSink message handlers void CRasterAnnSink::OnAnnCreate(long hAnnObject) { m_pView->HandleAnnCreate(hAnnObject); } void CRasterAnnSink::OnAnnClicked(long hAnnObject) { m_pView->HandleAnnClicked(hAnnObject); } void CRasterAnnSink::OnAnnDrawn(long hAnnObject) { m_pView->HandleAnnDrawn(hAnnObject); } void CRasterAnnSink::OnAnnToolDestroy() { m_pView->HandleAnnToolDestroy(); } void CRasterAnnSink::OnAnnToolChecked(short iTool) { m_pView->HandleAnnToolChecked(iTool); } void CRasterAnnSink::OnAnnMouseDown(short Button, short Shift, long x, long y) { m_pView->HandleAnnMouseDown(Button, Shift, x, y); } void CRasterAnnSink::OnAnnMouseMove(short Button, short Shift, long x, long y) { m_pView->HandleAnnMouseMove(Button, Shift, x, y); } void CRasterAnnSink::OnAnnMouseUp(short Button, short Shift, long x, long y) { m_pView->HandleAnnMouseUp(Button, Shift, x, y); }