the following procedure works with Windows XP, 7-32, 7-64, 8-32, 8-64, with version of IE 8 to 11 more not work fot the new Windows 10, see the code:
try
IDoc := CreateComObject(Class_HTMLDOcument) as IHTMLDocument2;
IDoc.Write(PSafeArray(VarArrayAsPSafeArray(VarArrayOf([xHtml])))); //Error windows 10
IDoc.Close;
except
on E: Exception do
begin
//E.ClassName = EOleException
//E.Message = Unspecified error
end;
end;
xHtml
is a string that contains the HTML "<html>...</html>"
also I tried to write the IHTMLDocument2 this way, but there was the same mistake:
IDoc := CreateComObject(Class_HTMLDOcument) as IHTMLDocument2;
v := VarArrayCreate([0, 0], VarVariant);
v[0] := xHtml;
IDoc.Write(PSafeArray(TVarData(v).VArray));
IDoc.Close;
Also I checked if there is a mshtml.dll
in windows 10, and there is.