Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/08/2022 in all areas

  1. Method 1 fails because, as it says HERE, "The onreadystatechange callback function was not implemented as a COM automation event in the IXMLHTTPRequest and IServerXMLHTTPRequest components." As you can see HERE, the IServerXMLHTTPRequest interface does not have any events defined. Therefore, there are no events for ObjEvent() to implement. Method 2 most likely fails because, even if the syntax for setting the .OnReadyStateChange property was correct, I'm not sure you can use DllCallBackRegister/DllCallbackGetPtr in this particular case. I'll leave the discussion of what's wrong with Method 3 to someone else. If your primary goal is to be able to identify ReadyState changes, then using ServerXMLHTTP, I would do something like the this: #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> async_serverxmlhttp_get_example() Func async_serverxmlhttp_get_example() Local $oComErr = Null #forceref $oComErr Local $sURL = "https://reqbin.com/echo/get/json" Local $hTimer = -1 Local $iPreviousReadyState = -1, _ $iCurrentReadyState = -1 ;Set local COM error handler $oComErr = ObjEvent("AutoIt.Error", "com_error_handler") If @error Then Exit MsgBox($MB_ICONERROR + $MB_TOPMOST, "ERROR", "Failed to set COM error handler") ConsoleWrite(@CRLF & "ServerXMLHTTP Request: " & $sURL & @CRLF) With ObjCreate("MSXML2.ServerXMLHTTP") ;Open asynchronous GET request and send it .Open("GET", $sURL, True) .Send() ;Loop until ready state is complete (4) or timeout occurs (5 seconds) $hTimer = TimerInit() While $iCurrentReadyState <> 4 And TimerDiff($hTimer) < 5000 $iCurrentReadyState = .readystate ;If ready state has changed, then save & display new ready state If $iPreviousReadyState <> $iCurrentReadyState Then $iPreviousReadyState = $iCurrentReadyState ConsoleWrite("Response Ready State: " & get_ready_state_desc($iCurrentReadyState) & @CRLF) EndIf Sleep(10) WEnd If $iCurrentReadyState <> 4 Then Exit ConsoleWrite("Timeout occurred waiting for response" & @CRLF) ;Display response info ConsoleWrite("Response Status: " & StringFormat("%i (%s)", .Status, .StatusText) & @CRLF) ConsoleWrite("Response Body: " & .ResponseText & @CRLF) EndWith EndFunc Func get_ready_state_desc($iReadyState) Local $sDesc = "" Switch $iReadyState Case 0 $sDesc = "Uninitialized" Case 1 $sDesc = "Loading" Case 2 $sDesc = "Loaded" Case 3 $sDesc = "Interactive" Case 4 $sDesc = "Complete" Case Else $sDesc = "Unrecognized" EndSwitch Return StringFormat("%s (%i)", $sDesc, $iReadyState) EndFunc Func com_error_handler($oError) With $oError ConsoleWrite(@CRLF & "COM ERROR DETECTED!" & @CRLF) ConsoleWrite(" Error ScriptLine....... " & .scriptline & @CRLF) ConsoleWrite(" Error Number........... " & StringFormat("0x%08x (%i)", .number, .number) & @CRLF) ConsoleWrite(" Error WinDescription... " & StringStripWS(.windescription, $STR_STRIPTRAILING) & @CRLF) ConsoleWrite(" Error RetCode.......... " & StringFormat("0x%08x (%i)", .retcode, .retcode) & @CRLF) ConsoleWrite(" Error Description...... " & StringStripWS(.description , $STR_STRIPTRAILING) & @CRLF) EndWith Exit EndFunc Console output from the script above: >Running:(3.3.14.5):C:\Portable Apps\AutoIt3\autoit3_x64.exe "C:\Projects\Personal\AutoIt\Test\A3Temp\a3_temp.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. ServerXMLHTTP Request: https://reqbin.com/echo/get/json Response Ready State: Loading (1) Response Ready State: Complete (4) Response Status: 200 (OK) Response Body: {"success":"true"} +>15:31:17 AutoIt3.exe ended.rc:0 +>15:31:17 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.6689
    1 point
  2. New version 2022.05.08 in first post Changed initial working directory to location of *.cmd file.
    1 point
  3. E4A Version 5.3 is finally out. This is a long-overdue major upgrade, as the library now supports ZLib compression for real and integer matrices stored on file (complex matrices are still always stored as raw binary data). Reloading compressed matrix files is transparent (existing functions are used; the dll automatically redirects to the decompression versions of the function if the compressed-flag is set in the matrix file header (bit 8 in the variable type ID field). Saving matrices individually in compressed form is done through new functions _Eigen_SaveMatrix_Compressed and _Eigen_SaveMatrix_Transposed_Compressed, but alternatively, you can opt to always automatically compress when saving by setting new global flag EIGEN_ALWAYSCOMPRESS to True (stored in Eigen4AutoIt.ini) , through _Eigen_SetAlwaysCompressed. Under the hood, de/compression actually consists of two different algorithms, a fast one for x86 (for small-sized matrices, using a dynamically allocated work buffer, so it may fail if it runs out of memory when trying to de/compress a huge matrix) and a slower one in x64-mode that can handle matrices/files of any size (including > 4 GB). So if you start getting out-of-memory errors when using E4A compression on x86, it's high time to switch to x64-mode if you can. See new test scripts _EigenTest_29a/b_FileCompression.au3 for examples. You can confirm the integrity of your data before compression vs. after decompression with new File I/O function _Eigen_GetMatrixHash_MD5, which returns the boost library's implementation of MD5 for any E4A matrix in memory. Note that the hash is computed over the matrix contents only; the matrix file header does not reside in memory and is thus excluded here (so computing the matrix file MD5 with a different utility would produce a different hash). Other new goodies include Transformation functions _Eigen_ClampValue*, to replace all values within a defined range with a single constant, and _Eigen_Rescale*, to replace a given linear range of values with a newly-defined range. Furthermore, in the C(ell)wise sections, there is now support (in CwiseUnaryOp*) for two-way rad/deg conversion and (in CwiseScalarOp*) for new bit-wise functions (for integer matrices only!) shift-left/right ("shl", "shr") and rotate-left/right (the latter also for the LSB/LSW part of values), i.e., "rol", "ror", "rol8", "ror8", "rol16", "ror16". Relevant Cwise test scripts have been updated as well, switching to an integer work environment when demonstrating CwiseScalar operators. Finally, the Eigen template library itself has been upgraded to latest stable release version 3.4.0. For the complete list of additions, changes, and fixes, see the History /ChangeLog page in the Help as per usual. I should mention that the online version of the new Help will only be upgraded to v5.3 in the near future, hopefully within the coming week. However, the installer includes a .chm version of the same document in the main Eigen4AutoIt directory. EDIT: and also as per usual, I managed to upload a version without the new rad/deg unary operators enabled, so please download again if you just did. Apologies for the oversight (I briefly moved development to another machine, and then the two versions diverged, and you know the rest...)
    1 point
  4. Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^
    1 point
×
×
  • Create New...