AnnGetHyperlinkParam example for C++ Builder

Note:

This topic is for Document/Medical only.

This example retrieves parameters using AnnGetHyperlinkParam.

//Global declarations
LEADRasterAnnotation * pRasterAnn= NULL;
LEADRasterAnnToolBar* pRasterAnnToolbar= NULL;

void __fastcall TForm1::Button1Click(TObject *Sender)
{
   CoCreateInstance(CLSID_LEADRasterAnnotation, NULL, CLSCTX_ALL, IID_ILEADRasterAnnotation, (void**)&pRasterAnn);
   CoCreateInstance(CLSID_LEADRasterAnnToolBar, NULL, CLSCTX_ALL, IID_ILEADRasterAnnToolBar, (void**)&pRasterAnnToolbar);
   pRasterAnn->AnnParentRasterView = LEADRasterView1->Raster;
   LEADEventSink1->Connect (pRasterAnn, DIID__LEADRasterAnnotationEvents);
   pRasterAnn->AnnUserMode = ANN_USERMODE_DESIGN ;
}
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
   if (pRasterAnn)
      pRasterAnn->Release ();
   if (pRasterAnnToolbar)
      pRasterAnnToolbar-> Release();
}

void __fastcall TForm1::Button2Click(TObject *Sender)
{
   long nParam0;
   long nParam1;
   long nParam2;
   long nParam3;
   long nParam4;

   pRasterAnn->AnnSetHyperlinkMsg (hGlobalAnn, ANN_LINK_ANNEVENT5, 1, 2, 3, 4, 5);

   pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 0);
   nParam0= pRasterAnn->AnnHyperlinkParam;
   pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 1);
   nParam1= pRasterAnn->AnnHyperlinkParam;
   pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 2);
   nParam2= pRasterAnn->AnnHyperlinkParam;
   pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 3);
   nParam3= pRasterAnn->AnnHyperlinkParam;
   pRasterAnn->AnnGetHyperlinkParam (hGlobalAnn, 4);
   nParam4= pRasterAnn->AnnHyperlinkParam;
   ShowMessage ("HyperlinkParams: " + IntToStr((int)nParam0) + "," + IntToStr((int)nParam1) + "," + IntToStr((int)nParam2) + "," + IntToStr((int)nParam3) + "," + IntToStr((int)nParam4));
}