Is there a better way to create objects in IScriptControl than this?
Result := SC.Eval('new Date()');
I need something like this:
function CreateJSObject(JSClassName: string; Params: PDispParams): OleVariant;
a naive implementation would be
var
S: string;
begin
S := '';
for I := P.cArgs - 1 downto 0 do
begin
if S <> '' then
S := S + ', ';
S := S + ConvertParamToJSSyntax(OleVariant(P.rgvarg[I]));
end;
Result := ScriptControl.Eval('new ' + JSClassName + '(' + S + ');');
end;