Jump to content

Recommended Posts

Posted (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 by Zoli_cr0
Posted

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

Posted

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

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
  • Recently Browsing   0 members

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