• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1327
  • Last Modified:

how to use HttpQueryInfo in VB?

hi, experts,
I need to use HttpQueryInfo() to get back Http response information from server such as statuscode. I used the following code in VB as:

Dim dwStatus As String * 1024
Dim bRet As Boolean, dwLen As Long
dwLen = 1024
bRet = HttpQueryInfo(hHttpRequest, HTTP_QUERY_STATUS_CODE, dwStatus, dwLen, "")

but, I always got bRet = False. I'm sure the server-side code is correct to send back its response information. I guess the problem is the argument dwLen of DLL: HttpQueryInfo() because it needs a pointer in definition. From VB I can't find how to declare a pointer.

By the way, we use Wininet.dll in client/server codes under WinNT and ISAPI platform.

Does Any expert has answer or clue for the problem?

thanks in advance,
1 Solution
I have a class that I use for http stuff with the wininet.dll API calls. It's kinda big so I uploaded it temporarily to


You will have to change the extension to .cls because Geocities thinks everything besides text files will spread virus.. or something. You can test it with code like

    Dim HTTP As New clsHTTP


Check inside the Connect function, there you can find working code for the hHttpOpenRequest API. This should help you to figure out how it works.

pxiaoAuthor Commented:
thanks very much. Your information is very helpful.

I need the same solution but i dont get access to the url. Can you help me asap.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now