AnnGetHyperlinkString example for C++ Builder
// This example is also for:
// AnnSetHyperlinkString method
// AnnGetItemHandle method
//The following example places calls to both the AnnSetHyperlinkString method and the AnnGetHyperlinkString method.
//Set AnnHyperLink to a URL
void __fastcall TForm1::LEADAnn1AnnHyperlinkMenu (L_PHANDLE phObjects,
int iCount)
{
int i;
char* szLink;
int strSize;
for (i=0; i < iCount; i ++ )
{
LEADAnn1->AnnSetHyperlinkString (LEADAnn1->AnnGetItemHandle (phObjects, i ), ANNLINK_WEBPAGE, "http://www.leadtools.com");
//get the string to see what got set
strSize= LEADAnn1->AnnGetHyperlinkString (LEADAnn1->AnnGetItemHandle (phObjects, i ), NULL);
if (strSize > 0)
{
szLink= (char *) malloc (strSize+1);
LEADAnn1->AnnGetHyperlinkString (LEADAnn1->AnnGetItemHandle (phObjects, i), &szLink);
ShowMessage (szLink);
free (szLink);
}
else
ShowMessage ( "Error setting Link" ) ;
}
}