Prueba con esta función:
Código Delphi
[-]
function StrToBin(Str: string): string;
var
i,j,k: Integer;
begin
Result:= '';
for i:= 1 to Length(Str) do
begin
j:= Byte(Str[i]);
k:= 128;
while k > 0 do
begin
if j >= k then
begin
Result:= Result + '1';
j:= j - k;
end else
Result:= Result + '0';
k:= k shr 1;
end;
end;
end;
Por ejemplo:
Código Delphi
[-]
ShowMessage(StrToBin(':( '));
Ahora volviendo a tu código:
Código Delphi
[-]
Result:=StrToInt(HexNum) ;
Result:=StrToInt('$' + HexNum) ;