I need to create a solution for a client of a web application that produces calculations of the position of the planets.
I was told to use this swedll32.dll library, and I did some testing and it works great in Delphi 7.
The problem is that I need to publish to a web application and I'm not getting it to work. I tried using .NET
What solution do I need:
-
A web application (any language) that accesses this dll and does the calculations
-
A hosting option for this application
For more details on the application follow links to sample codes and documentation.
I'll put a very simple delphi code snippet to understand what I need.
Very grateful =)
function swe_julday(year : integer;
month : integer;
day : integer;
hour : double;
gregflag : integer
) : double; stdcall; far; external 'swedll32.dll' name '_swe_julday@24';
function swe_calc(tjd : double; {Julian day number}
ipl : Integer; {planet number}
iflag : Longint; {flag bits}
var xx : double; {first of 6 doubles}
sErr : PChar {Error-String}
): Longint; stdcall; far; external 'swedll32.dll' name '_swe_calc@24';
function PegaPosicaoDoPlaneta() : string;
var
tjd,
dhour,
tjdet : double;
planet_number : integer
iday, imonth, iyear : integer;
iflag, rflag : Longint;
xx : Array[0..5] of double;
serr : Array[0..255] of Char;
sjul: String[30];
resultado : string;
begin
iday := 1;
imonth := 1;
iyear := 2016;
ihour := 11;
imin := 59;
isec := 00;
dhour := ihour + imin / 60.0 + isec / 3600.0;
tjd := swe_julday(iyear, imonth, iday, dhour, 1);
planet_number := 0;
iflag := 0;
rflag := swe_calc(tjd, planet_number, iflag, xx[0], serr);
Str(xx[0]:16:10, sjul);
resultado := 'Planeta ' + IntToStr(planet_number) + ' na posicao = ' + sjul;
result := resultado;
end;