>You have everything correct on your call to InternetSetOption function call.
>Except that you should always add a CHR(0) to the end of any strings passed in API calls, just to be safe.
That was one of the things I tried, and since it didn't make a difference, I took it out. Thanks for the pointer (no pun intended) though.
>The problem is in the InternetOpen function call. The second, third and fourth parameter defines the type of handle that is created. You are trying to set proxy information with the InternetSetOption. In this case, the internet connection must be connected through a proxy server for the InternetSetOption call to work. In all other cases it fails with the 12018 error message.
Aaaaaahhhhhhh. That was the information I was looking for. I am not working through a proxy server here, so I couldn't do that. This function is for the small 1% of my user base that gets to the internet through a proxy that requires a login with the connection. I had not worked all the way through how I was going to test this, but I guess I will need to install a proxy server on my dev machine eh?
>So the InternetOpen call would look something like this:
>
>hInternet = InternetOpen("someagent", INTERNET_OPEN_TYPE_PROXY, "50.50.50.1", NULL, 0)
>
Actually, I was hoping that INTERNET_OPEN_TYPE_PRECONFIG (0) would do it on machines with a proxy server. It just didn't occur to me that InternetSetOption would be smart enough to know that the handle it had was not through a proxy. The user setting screen in my application makes you specify one of the three connection settings (Proxy, direct, IE settings) and then uses that to set the connection type, but it defaults to "IE settings". I guess it will still work with this connection type if the machine actually is using a proxy?
>If you need a proxy server software package to test with, I know of a freeware version that works great on NT. It only supports 2 or 3 concurrent connections though, unless you register it.
I guess I need one to iron this out. Where might I find it?
Erik Moore
Clientelligence