Annotation Declaration Information
Assume the following class member declarations:
CLEADRasterView m_LEADRasterView1; // LEADRasterView control
ILEADRasterAnnotation * m_pRasterAnn; // LEAD Annotation COM object
The following code is called when the application starts
CoCreateInstance(
CLSID_LEADRasterAnnotation,
NULL,
CLSCTX_ALL,
IID_ILEADRasterAnnotation,
(void**)&m_pRasterAnn);
//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
m_LEADRasterView1.GetRaster().UnlockSupport(L_SUPPORT_DOCUMENT, L_KEY_DOCUMENT);
//Attach the annotation object to the raster view control
IDispatch *pDispatch=NULL;
LPUNKNOWN pIUnknownNoRelease = m_LEADRasterView1.GetControlUnknown();
pIUnknownNoRelease->QueryInterface(IID_IDispatch, (void**)&pDispatch);
m_pRasterAnn->PutAnnParentRasterView(pDispatch);
if(pDispatch)
pDispatch->Release();
m_pRasterAnn->PutAnnAutoUpdate(TRUE);
*** The following code is called when the application ends
m_pRasterAnn->Release();