Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errors on winhttp.h

118 views
Skip to first unread message

Thorsten Kettner

unread,
Jul 16, 2007, 5:39:09 AM7/16/07
to

Has anyone successfully included winhttp.h yet? I get a lot of
warnings and errors trying it:

[C++ Warning] winhttp.h(46): W8017 Redefinition of 'BOOLAPI' is
not identical
...
'HTTP_VERSION_INFO'
[C++ Error] wininet.h(462): E2344 Earlier declaration of 'HTTP_VERSION_INFO'
...

I tried NO_WIN32_LEAN_AND_MEAN, but that didn't change anything.
I replaced wininet.hpp by an empty file, as this is the one
containing HTTP_VERSION_INFO, but then I get the error E2189
Cannot initialize external variable on this code in winhttp.h:

BOOLAPI
WinHttpTimeFromSystemTime
(
__in CONST SYSTEMTIME *pst, // input GMT time
__out_ecount(WINHTTP_TIME_FORMAT_BUFSIZE) LPWSTR pwszTime // output string buffer
);

The thing I actually want to do with winhttp is to call a
website silently from my code and read its html.

TIA,
Thorsten.

Mike Collins

unread,
Jul 16, 2007, 8:31:49 AM7/16/07
to
not sure about your compile error, some headers are dependent on others, or
there may be a situation where you have got some sort of circular reference.

I've never had to look at winhttp.h before but you can do exactly what you
are trying to do using the wininet api's - these seem to be the prefered
option now. I have a working system using the wininet api's to connect to a
url and download update information - it will be exactly the same for you i
suppose.

If you want to examin this option and need any help, please feel free to
post back and i'll send you some pointers.

Regards,

Mike

"Thorsten Kettner" <QUESTIONBYtho...@otto.de> wrote in message
news:469b3cbd$1...@newsgroups.borland.com...

Thorsten Kettner

unread,
Jul 19, 2007, 10:41:37 AM7/19/07
to

>"Thorsten Kettner" wrote:
>> The thing I actually want to do with winhttp is to call a
>> website silently from my code and read its html.

"Mike Collins" <its@TheBottomOfThePost> wrote:
>I've never had to look at winhttp.h before but you can do
>exactly what you are trying to do using the wininet api's -
>these seem to be the prefered option now.

For a quick solution I have switched to TCppWebBrowser just to
get started with something, but I should really try wininet.
Thank you for the hint Mike.

Thorsten.

0 new messages