Home > Software engineering >  VB6 use wininet. DLL method HttpOpenRequestA returns 0, the error code is 87?
VB6 use wininet. DLL method HttpOpenRequestA returns 0, the error code is 87?

Time:11-13

Read on the Internet the VB code, is to use InternetOpenA first and then use InternetConnectA, with HttpOpenRequestA finally done, run successful return value is a number, is to handle, but no matter how I change, HttpOpenRequestA return is zero, and Err LastDllError return number is 87, the same API on top of other language is possible, do not know can you help me with a great god, what exactly where the problem is?

Code is almost so I write, is called the wininet. DLL interface, including - 2147467248 is my pick out elsewhere, would have been some constants or as a result,
Public Sub testaaa ()
Dim As Long a
Dim As Long b
Dim As Long c

A=InternetOpenA (" Mozilla/5.0 (Windows NT 6.1; Win64. X64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.75 Safari/537.36 ", 1, ""," ", 0)
A, b=InternetConnect (" www.baidu.com ", 80, ""," ", 3, 0, 0)
C=HttpOpenRequestA (b, "GET", "/", "HTTP/1.1," vbNullString, 0, 2147467248, 0)
The Debug. Print Err. LastDllError

The Debug. Print a; b; C
End Sub
  •  Tags:  
  • API
  • Related