[lazarus] How to do a cast in fpc (i'm just stuck in doors)

Michal Bukovjan bukovjan at mbox.dkm.cz
Wed May 29 17:32:33 EDT 2002


marius popa wrote:

>Want to do a cast from "VOID_POINTER" to "TFIBBASE" because 
>of this  error :
>
>Compiling fibdatabase.pp
>fibdatabase.pp(529,22) Error: Incompatible types: got "VOID_POINTER" expected "TFIBBASE"
>fibdatabase.pp(568,26) Error: Incompatible types: got "VOID_POINTER" expected "TFIBTRANSACTION"
>
>and here is my 529 offensing line :
>
>function TFIBDatabase.GetDataSet(Index: Integer): TFIBBase;
>begin
>  result := FDataSets[Index];
>end;
>
>where TFIBase is :
>  TFIBBase = class(TObject)
>  protected
>    FDatabase: TFIBDatabase;
>...........................
>  end;
>and FDataSets is declared :
>
>  FDataSets           : TList;
>
>  
>
Result:= TFIBDatabase(FDataSets[Index]);

does not work?

Michal






More information about the Lazarus mailing list