Jump to content

Event handler for XMLHTTP


Recommended Posts

Guys,

I'm having trouble setting up the event handler for Microsoft.XMLHTTP. I read some sugestions on the forum but i keep getting error (no such interface supported).

ANYONE knows how to code the event handler for XMLHTTP?

->(configured by onreadystatechange - http://msdn.microsoft.com/en-us/library/ms762767(VS.85).aspx)

Something like this:

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")

$objHTTP = ObjCreate("MSXML2.XmlHttp.6.0") ;or MSXML2.XmlHttp; or Microsoft.XMLHTTP

ObjEvent($objHTTP,"Evt_")

$objHTTP.open ("post", "some site", True)

$objHTTP.onreadystatechange("onreadystatechange") ; also don't know how to reference my function here..

$objHTTP.send ("something")

Func Evt_onreadystatechange()

$o = @COM_EventObj

msgbox (0,"msg", $o.state)

Endfunc

Func MyErrFunc()

$HexNumber=hex($oMyError.number,8)

Msgbox(0,"COM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _

"err.description is: " & @TAB & $oMyError.description & @CRLF & _

"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _

"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF)

SetError(1)

Endfunc

Any help is appreciated! This one is killing me!

Thanks :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...