Thread View: borland.public.cppbuilder.nativeapi
1 messages
1 total messages
Started by Mike Collins
Wed, 21 Feb 2007 21:12
WinInet, InternetOpen and Proxy settings...
Author: Mike Collins
Date: Wed, 21 Feb 2007 21:12
Date: Wed, 21 Feb 2007 21:12
39 lines
2131 bytes
2131 bytes
Hi all, just a quick question on using proxy settings with InternetOpen.
I have a live update system in place which works perfectly, however, some
customers have come back and requested the facility to input and use a proxy
server. Having looked at the MSDN reference it seemed pretty easy to
implement this within the initial InternetOpen call.
My code looks like this:
DWORD dwAccessType;
AnsiString szProxySz;
if (getProxyOptions())
{
dwAccessType = INTERNET_OPEN_TYPE_PROXY;
szProxySz = AnsiString("\"\"http=http://" + getProxyAddress() + ":" +
getProxyPortNum() + "\"\"");
}
else
{
dwAccessType = INTERNET_OPEN_TYPE_DIRECT;
szProxySz = NULL;
}
hINetHnd = InternetOpen(TEXT("Live Update"), dwAccessType,
szProxySz.c_str(), NULL, 0);
if (!hINetHnd)
throw EAbort(SysErrorMessage(GetLastError()), 0);
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"
Just a quick point before anyone suggests it, I can't use the preconfigured
proxy settings because of the context that my code is running in. Does
anyone have any ideas what I'm doing wrong here?
Many thanks in advance,
Mike C
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads