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,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.