broznic 0 Newbie Poster

Hi everyone,

I am having a problem with this code in VB6:

Public Function test()
    hOpen = InternetOpen("Example",  _
                                     INTERNET_OPEN_TYPE_PRECONFIG, _
                                     vbNull, _
                                     vbNull, _
                                     0)
    REM InternetOpen goes OK
 
    hConnectHandle = InternetConnect(hOpen, _
                                    "google.com", _
                                    INTERNET_DEFAULT_HTTP_PORT, _
                                    vbNullString, _
                                    vbNullString, _
                                    INTERNET_SERVICE_HTTP, _
                                    0, _
                                    0)
   REM here I don't get error message but hConnectHandle gets value 0 and Err.LastDllError gets value 87

end function

The source code I started from is at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/handling_authentication.asp but it is in C.

There is also another page at http://www.vbip.com/forum/topic.asp?id=4686 that seems to report similar problem bat not with InternetConnect function, it works for them.

Can anybody tell me what am I doing wrong?

Of course, I do have needed function declarations in module and there is no problem at compile time.

Thanks.