AnnUnlock Example for Delphi
var
//Global declarations
RasterAnn: LEADRasterAnnotation;
RasterAnnToolbar: LEADRasterAnnToolBar;
procedure TForm1.Button1Click(Sender: TObject);
begin
RasterAnn:= CoLEADRasterAnnotation.Create ();
RasterAnnToolbar:= CoLEADRasterAnnToolBar.Create ();
RasterAnn.AnnParentRasterView := LEADRasterView1.Raster;
RasterAnnToolbar.AnnParentRasterView := LEADRasterView1.Raster;
LEADEventSink1.Connect (RasterAnn, _LEADRasterAnnotationEvents);
RasterAnn.AnnUserMode:= ANN_USERMODE_DESIGN;
end;
//This is also the example for AnnGetLocked method.
//If an object is found to be locked, using AnnGetLocked method, the object is unlocked, //by AnnUnlock, using the key ‘abcd’.
//hGlobalAnn is a global handle to an annotation object
procedure TForm1.Button2Click(Sender: TObject);
var
bLocked: WordBool;
begin
RasterAnn.AnnGetLocked (hGlobalAnn);
blocked:= RasterAnn.AnnLocked;
if (bLocked) then
RasterAnn.AnnUnlock (hGlobalAnn, 'abcd');
end;