Jump to content

Can't get ObjEvent to work with ObjCreate("winhttp.winhttprequest.5.1")


Recommended Posts

It errors out Autoit during the $oHTTP.send() line. =( A nudge in the right direction would be very much appreciated. Thank you!

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$EventObject=ObjEvent($oHTTP,"Event_")
$oHTTP.open("GET", "http://google.com", true)
$oHTTP.send()

While 1
    Sleep(100)
Wend

Func Event_()
    msgbox(0,'Test','This is only a test')
Endfunc
Link to comment
Share on other sites

That produces and unhandled exception in AutoIt. It needs a bug report. Since you found it, care to take a shot at entering it? Look for the Bug Trac link at the top of the page.

The reproducer code can be simplified to:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$EventObject = ObjEvent($oHTTP, "Event_")
$oHTTP.open("GET", "http://google.com", True)
$oHTTP.send()

+>22:41:14 Starting AutoIt3Wrapper v.1.10.1.14  Environment(Language:0409  Keyboard:00000409  OS:WIN_VISTA/Service Pack 1  CPU:X86  ANSI)
>Running AU3Check (1.54.14.0)  from:C:\Program Files\AutoIt3
+>22:41:14 AU3Check ended.rc:0
>Running:(3.3.0.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Users\blah\tmp.au3" 
!>22:41:17 AutoIT3.exe ended.rc:-1073741819
+>22:41:18 AutoIt3Wrapper Finished
>Exit code: -1073741819 Time: 4.800

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thank you very much for the reply Dale. I submitted it, I hope I did it properly =) Is there any workaround? I really need a way to make get requests asynchronous, and that was the only way I've yet to discover =( Right now I use a main script which communicates with 20 clients over TCP to make all the requests and it is really quite ugly. Any advice is much appreciated, thank you.

Link to comment
Share on other sites

I submitted it, I hope I did it properly =)

Track #865: winhttp.winhttprequest.5.1 ObjEvent unhandled exception

Valik reviewed it and didn't flame you -- now that's a successful first bug report. Congratulations!

:P

:unsure:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

In addition to the Vista 3.3.0.0 test above, I tested on Windows XP with 3.2.12.0 with the same result (added this to the Trac ticket as well).

Bummer. I needed to use this this week myself. I currently see no workaround inside AutoIt for this. Perhaps Valik or another Dev will have an insight to a workaround once the failure mechanism is analyzed.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...