Sign in to follow this  
Followers 0
zhaicheng

How to ignore "error" to avoid collapsing

5 posts in this topic

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$oHTTP.Send()

When connecting speed is bad,my code is having a problem- Action Faild,and then Autoit collaps.

Is there any way to avoid this error?

Maybe using if @error?How to use it?

Share this post


Link to post
Share on other sites



I have read it,still,I don't know how to handle it?Would you please elaborate? Thanks!

Share this post


Link to post
Share on other sites

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

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")

$a=$oHTTP.Open("GET","http://kds.zj.com")

$oHTTP.Send()

$HTMLSource = $oHTTP.Responsetext

MsgBox(0,'',$HTMLSource)

Func MyErrFunc()

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

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

"Number is: " & $HexNumber & @CRLF & _

"Windescription is: " & $oMyError.windescription )

$_eventerror = 1

Endfunc

Share this post


Link to post
Share on other sites

Gideon ,I really appreciate all your kind help.

Share this post


Link to post
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
Sign in to follow this  
Followers 0