How to use InternetGetProxyInfo from jsproxy.dll
I'm trying to get the non-static proxy settings, assigned with proxy.pac, on a WinForms client using WinINet and a function called InternetGetProxyInfo from jsproxy.dll.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetgetproxyinfo.asp
I'm not sure if this is done correctly, but I'm using the following:
[DllImport("jsproxy.dll")]
private extern static bool InternetGetProxyInfo(string url,
byte urllength,
string hostname,
byte hostnamelength,
out string pointer,
out byte pointerlength);
When I'm calling it with the following, the output parameter for ProxyHostName (mypointer, string) keeps returning null, even though I'm sure that IE is using a proxy.
InternetGetProxyInfo("http://www.mydomain.dk", 22, "www.mydomain.dk", 15, out mypointer, out mypointerlength);
The call it self returns true, indicating, that the call went well.
Does someone have any ideas ?
Thanks,
Thomas