AnnParentRasterView example for C++ Builder
/*This sample shows the minimal code to use the LEAD Annotation COM object
LEADRasterView1 is a LEAD Raster View control*/
void __fastcall TForm1::AnnParentRasterViewClick(TObject *Sender)
{
LEADRasterAnnotation * pRasterAnn;
CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
//Unlock the annotation support
//Note that L_KEY_DOCUMENT is a #define for the support key that you must supply
LEADRasterView1->Raster->UnlockSupport (L_SUPPORT_DOCUMENT, AnsiToOLESTR( L_KEY_DOCUMENT ));
//Attach the annotation object to the raster view control
pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
//Automatically update annotations with raster changes
pRasterAnn->AnnAutoUpdate = true;
//...
//... the rest of the program
//...
pRasterAnn->Release();
}