First this: I agree with @DavidHeffernan: please (pretty please) search for a way to perform the logic in Delphi.
Follow these steps:
- Find the Import Type Library menu function, depending on the Delphi version it may be under different top menu's (typically Components or Tools), or have a different name (Import ActiveX, Import COM object...)
- From the list of known type libraries, select "Microsoft Script Control", the highest version in the list (but chances are it's still just version 1.0)
- Create the wrapper unit
Then use an instance of the TScriptControl
object, perhaps like this:
var
sc:TScriptControl;
sa:PSafeArray;
code:WideString;
rs:TResourceStream;
begin
rs:=TResourceStream.Create(HInstance,'RSADATA',MakeIntResource(101));
try
SetLength(code,rs.Size div 2);
rs.Read(PWideChar(code)^,rs.Size);
finally
rs.Free;
end;
sc:=TScriptControl.Create(nil);
try
sc.Language:='Javascript';
sc.Reset;
sc.AddCode(code);
sa:=PSafeArray(TVarData(VarArrayOf([data1,data2])).VArray);
sc.Run('createRsaKey',sa);
finally
sc.Free;
end;
end;