{$APPTYPE CONSOLE}
program
 PointerNature ;

uses
 SysUtils ; 

const
 CLASS_CHECK_STRING = 'This is some TSomeClass.';

type
 TSomeClass = class
   constructor Create;
   procedure AbstractException; virtual; abstract;
   function  IsSomeClass : string; virtual;

  end;

constructor TSomeClass.Create;
begin
end;

function TSomeClass.IsSomeClass;
begin
 result:=CLASS_CHECK_STRING;

end;

function IsClassOfTSomeClass(x : pointer ) : boolean;
begin
 result:=false;

 if x <> NIL then
  try
   TSomeClass(x ).AbstractException;

  except
   on E:EAbstractError do
    try
     if TSomeClass(x ).IsSomeClass = CLASS_CHECK_STRING then
      result:=true;

    except

    end;

   else

  end;

end;

var
 TestClass : TSomeClass;

BEGIN
 TestClass:=TSomeClass.Create;

 if IsClassOfTSomeClass(pointer(1234 ) ) then
  writeln('12345 is a class of TSomeClass :-)' )
 else
  writeln('12345 is NOT a class of TSomeClass !' );

 if IsClassOfTSomeClass(TestClass ) then
  writeln('TestClass is a class of TSomeClass :-)' )
 else
  writeln('TestClass is NOT a class of TSomeClass !' );

END.