About ActiveX control.

I create an ActiveX Control with Delphi5 : New|ActiveForm
D5produce some source code automatically,among them there is a
function:

function TActiveFormX.Get_BorderWidth: Currency;
begin
  Result := Currency(BorderWidth);
end;

But the compiler says there is an error:Invalid typecast.
Why this happen? How to solve it?
Why the code which D5 produce automatically is error?