I'm trying to do something like this:
function CreateIfForm ( const nClass : TClass ) : TForm;
begin
if not ( nClass is TFormClass ) then
raise Exception.Create( 'Not a form class' );
Result := ( nClass as TFormClass ).Create( Application );
end;
This produces error "Operator not applicable to this operand type". I'm using Delphi 7.