I am migrating an application from Delphi 7 to dotnet (Delphi 2005).
Could anyone suggest how to deal with the following piece of code
function sortfunction(A, B: Pointer):integer;
begin
Result := 0;
if TMyObject(A).GetKey < TMyObject(B).GetKey then
Result := -1
else
Result := 1;
end;
When compiled in Delphi2005, I'm getting an E2089 InValid typecast error
Is this not supported in dotnet? if so can anyone suggest a workaround
please
I'm having many descendent classes of TMyObject, all of which are using
the sort function
--- posted by geoForum on http://delphi.newswhat.com
function sortfunction(A,B: TMyObject): Integer; ...
> I am migrating an application from Delphi 7 to dotnet (Delphi 2005).
> Could anyone suggest how to deal with the following piece of code
>
> function sortfunction(A, B: Pointer):integer;
> When compiled in Delphi2005, I'm getting an E2089 InValid typecast error
> Is this not supported in dotnet? if so can anyone suggest a workaround
> please
For .NET the sort function must be defined as:
function sortfunction(A, B: TObject):integer;
Additionally it can now be an object method or class function.
--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com
It worked, :)