Knowledge Base

KB10530 - Determine if layer is vector without using the InheritsFrom() function.

You can try to test inheritance using a procedure like the following:

function IsInherited(const _object: TObject; const _name: WideString):
 obj: TObject;
 ref: TClass;
 txt: string;
 Result := False;

 if not Assigned(_object) then

 ref := obj.ClassType;
 while (ref <> nil) and (not Result) do
   Result := ref.ClassNameIs(txt);
   ref := ref.ClassParent;

And test inheritance from TGIS_LayerVector using

IsInerited( my_object, "TGIS_LayerVector" )
Created: December 10, 2004, Modified: September 10, 2015
follow us on Facebook  follow us on Twitter  follow us on Google +  follow us on LinkedIn  Embarcadero