I am trying to call Winhttp.dll from a VB app. I specifically need to carry out this process using windows native DLL's, not COM objects.
When I run the attached code, I get the error 12005, could someone explain why, and offer a solution.
Please note my final solution will be adapted to run in an uncommon language (Omnis 7), so please keep this in mind for your replies.
Public Declare Function WinHttpOpen Lib "WinHttp.dll" (ByVal pwszUserAgent As String, ByVal dwAccessType As Int32, ByVal pwszProxyName As String, ByVal pwszProxyBypass As String, ByVal dwFlags As Int32) As Int32
Public Declare Function WinHttpConnect Lib "WinHttp.dll" (ByVal Hsession As Int32, ByVal SiteAddress As String, ByVal Port_Number As Int32, ByVal dwvalue As Int32) As Int32
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hsession As Int32
Dim hconnect As Int32
Dim Herror As Int32
'Dim Exception As String
Dim URL As String
URL = "www.google.co.uk"
hsession = WinHttpOpen("Visual Basic", 0, "", "", 0)
hconnect = WinHttpConnect(hsession, URL, 80, 0)
Herror = Err.LastDllError
If Herror = 12005 Then