Using the HTTPXMLRequest onreadystatechange property from VB

When using the MS XML object from a Visual Basic application to send and receive WebDAV data, you need to use the HTTPXMLRequest interface. To do asynchronous calls, you need to set the onreadystatec

ITPro Today

February 18, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today

When using the MS XML object from a Visual Basic application to send and receive WebDAV data, you need to use the HTTPXMLRequest interface. To do asynchronous calls, you need to set the onreadystatechange property with the function to call when your readystate changes (ie. when your call finishes). You unfortunately can not DIM your HTTPXMLrequest interface WITH EVENTS like you can with the XMLDOM interface. Also, unlike VBScript, you can not use the GetRef function to create a object that represents a function. In order to set this property from a VB Application (form or DLL), you need an object. 1) Create an new class module for your application. 2) Create a single function (with no parameters). 3) Set this function as the default for the class. 4) In your XML request code, create an object of your class module. 5) Set the XMLHTTPRequest.OnReadyStateChange property equal to your new object. Your default function will be called everytime the readystate changes for your XMLHTTPREQUEST object.

Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like