Zoli_cr0 Posted September 6, 2017 Share Posted September 6, 2017 (edited) Hi all, recentrly I upgraded my Autoit to 3.3.14.2, since then my function don't work, the compiler return an error at $oHTTP.Quit : "C:\Program Files (x86)\AutoIt3\Include\odc.au3" (37) : ==> The requested action with this object has failed.: $oHTTP.Quit $oHTTP^ ERROR With version 3.3.12 this UDF work's perfectly, please help me to figgure out why don't work as expected func ODC_comm(byref $DES_Link, ByRef $xml_string) $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("Post", $DES_Link , False) $oHTTP.Send($xml_string) $Response = $oHTTP.ResponseText $StatusCode = $oHTTP.Status $oHTTP.Quit $oHTTP = 0 Return $Response EndFunc Thx Edited September 6, 2017 by Zoli_cr0 Link to comment Share on other sites More sharing options...
badcoder123 Posted September 7, 2017 Share Posted September 7, 2017 Maybe you need the parentheses? I generally use javascript for this but I think what you want it $oHTTP.quit() Link to comment Share on other sites More sharing options...
ripdad Posted September 7, 2017 Share Posted September 7, 2017 This page at MSDN shows Events, Methods and Properties of the WinHttpRequest object... https://msdn.microsoft.com/en-us/library/windows/desktop/aa384106(v=vs.85).aspx There is not a QUIT method. So, your calling a method that doesn't exist and the result is an error. There is an ABORT method, but it's not the same thing. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
badcoder123 Posted September 7, 2017 Share Posted September 7, 2017 $ie = ObjCreate("InternetExplorer.Application") With $ie .quit() EndWith I'd assume you're using Internet Explorer so you could use this... Another alternative is to WinClose($hWnd) if you're trying to quit/end the process. Link to comment Share on other sites More sharing options...
ripdad Posted September 7, 2017 Share Posted September 7, 2017 Just returning from the function will destroy the WinHttpRequest object. If you don't trust that, you could null the object... $oHTTP = "" or $oHTTP = 0, which you did in the first post. "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now