I am using using the Raises routine to configure use proxy within the system. It works perfectly in delphi in version 7. In Delphi 10.2 (Tokyo), even compiling without errors, when calling the routine informs that the proxy is not responding (being that the proxy is ok and worked in delphi 7 call).
Would anyone have any idea what might be going on?
function ApplyProxy(proxy: string):Boolean;
var
MyInternetProxyInfo: PInternetProxyInfo;
begin
try
Result:=False;
proxy:=Trim(proxy);
MyInternetProxyInfo:=New(PInternetProxyInfo);
try
if proxy = EmptyStr then
MyInternetProxyInfo^.dwAccessType := INTERNET_OPEN_TYPE_DIRECT else
begin
MyInternetProxyInfo^.dwAccessType := INTERNET_OPEN_TYPE_PROXY;
MyInternetProxyInfo^.lpszProxy := PAnsiChar(Trim(proxy));
MyInternetProxyInfo^.lpszProxyBypass := PAnsiChar('<local>');
end;
Result:=InternetSetOption(nil, INTERNET_OPTION_PROXY, MyInternetProxyInfo,
SizeOf(MyInternetProxyInfo^));
finally
Dispose(MyInternetProxyInfo);
end;
except
Result:=False;
end;
end;