Hello everyone,


What is wrong with my simple code below? I have tried to figure it out in 40
minutes, but failed.

[Code]
1>main.cpp
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) :
error C2146: syntax error : missing ';' before identifier 'HINTERNET'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) :
error C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) :
error C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) :
error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) :
error C4430: missing type specifier - int assumed. Note: C++ does not support
default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) :
error C2378: 'HINTERNET' : redefinition; symbol cannot be overloaded with a
typedef


#include <wininet.h>

int main()
{
InternetOpen ("Test Agent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);

return 0;
}
[/Code]


thanks in advance,
George

Re: compile error for function InternetOpen by Igor

Igor
Mon Oct 06 06:53:09 CDT 2008

"George" <George@discussions.microsoft.com> wrote in message
news:45AFF5E1-9512-49CD-A4E8-770F99BD8D9B@microsoft.com
> What is wrong with my simple code below? I have tried to figure it
> out in 40 minutes, but failed.
>
> [Code]
> 1>main.cpp
> 1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58)
> : error C2146: syntax error : missing ';' before identifier
> 'HINTERNET'

Include <windows.h> before <wininet.h>
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: compile error for function InternetOpen by George

George
Mon Oct 06 07:04:00 CDT 2008


Thanks Igor,


Fixed. //shamed.


regards,
George