Article View: borland.public.cppbuilder.nativeapi
Article #2473Re: WinInet, InternetOpen and Proxy settings...
From: Mike Collins
Date: Thu, 22 Feb 2007 01:00
Date: Thu, 22 Feb 2007 01:00
57 lines
2947 bytes
2947 bytes
Hay Remy - that was simple :-)
Haven't had chance to test it fully as i'm at home at the minute (thus no
proxy) but the error message has gone - suggesting it works.
The only reason why i doubled up on the quotation marks is because of the
MSDN reference:
http://msdn2.microsoft.com/en-us/library/aa383996.aspx
[sic]
To list a proxy for a specific protocol, the string must follow the format
""<protocol><protocol>://<proxy_name>"". The valid protocols are HTTP,
HTTPS, FTP, and Gopher. For example, to list an FTP proxy, a valid string
would be ""ftp=ftp://ftp_proxy_name:21"", where ftp_proxy_name is the name
of the FTP proxy and 21 is the port number that must be used to access the
proxy. If the proxy uses the default port number for that protocol, the port
number can be omitted. If a proxy name is listed by itself, it is used as
the default proxy for any protocols that do not have a specific proxy
specified. For example, ""http=http://http_proxy other"" would use
http_proxy for any HTTP operations, while all other protocols would use
other.
- all the examples have double quote marks...
Thanks anyway,
Mike C
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:45dcd1f8$1@newsgroups.borland.com...
>
> "Mike Collins" <its@TheBottomOfThePost.com> wrote in message
> news:45dcb57a$1@newsgroups.borland.com...
>
>> szProxySz = AnsiString("\"\"http=http://" + getProxyAddress()
> + ":" +
>> getProxyPortNum() + "\"\"");
>
> You have a lot of quotation marks in that string. Try removing them:
>
> szProxySz = "http=http://" + getProxyAddress() + ":" +
> getProxyPortNum();
>
>> When no proxy setting are enabled, the code works without problem.
>> When they are enabled, with valid values, the InternetOpen call
> fails and
>> GetLastError returns, "Parameter are Incorrect"
>
> That is because you are specifying a malformed string value for the
> proxy name.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<45dceaf4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<45dcb57a$1@newsgroups.borland.com> <45dcd1f8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,8d28b2a3d9a6eaf6 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Mike Collins" <its@TheBottomOfThePost.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <45dcb57a$1@newsgroups.borland.com> <45dcd1f8$1@newsgroups.borland.com> Subject: Re: WinInet, InternetOpen and Proxy settings... Date: Thu, 22 Feb 2007 01:00:11 -0000 Lines: 59 Organization: SDA Ltd X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.3790.2826 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2826 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 89.241.207.15 Message-ID: <45dceaf4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1172105972 89.241.207.15 (21 Feb 2007 16:59:32 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail