AnnGetHyperlinkString example for Delphi
// 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
procedure TForm1.LEADAnn1AnnHyperlinkMenu(phObjects: L_PHANDLE;
iCount: Integer);
var
i: Integer;
szLink: PChar;
strSize: Integer;
begin
for i:= 0 to iCount - 1 do
begin
LEADAnn1.AnnSetHyperlinkString ( LEADAnn1.AnnGetItemHandle(phObjects, i ), ANNLINK_WEBPAGE, PChar('http://www.leadtools.com'));
//get the string to see what got set
strSize:= LEADAnn1.AnnGetHyperlinkString(LEADAnn1.AnnGetItemHandle(phObjects, i ), Nil);
if ( strSize > 0 ) then
begin
szLink:= AllocMem (strSize+1);
LEADAnn1.AnnGetHyperlinkString (LEADAnn1.AnnGetItemHandle (phObjects, i), @szLink);
ShowMessage ( szLink ) ;
FreeMem ( szLink ) ;
end
else
ShowMessage ( 'Error setting Link' ) ;
end;
end;