Leaderboard
Popular Content
Showing content with the highest reputation on 02/24/2021 in all areas
-
TeraCopy Cure
FrancescoDiMuro and one other reacted to TheSaint for a topic
TeraCopy Cure has been updated to v1.6. See first post for the download and new screenshot. (v1.6) Added LEFT and RIGHT window move buttons to give easier access to what might be covered by the program window. The DELAY assigned to a job is now displayed as a status field countdown. The program name (green) label now shows the input source size until source is added to the Batch List. Most controls (buttons, list, etc) are now disabled while size of source is being determined. Bugfix for duplicate delay renaming.2 points -
Hello @jugador I hadn't had time to review. Are you trying to read from AutoIt script instead using Excel? If It's so You could do it these way. It's a little messed but you can clear it. #AutoIt3Wrapper_UseX64=N #include <AutoItConstants.au3> #include <WinAPI.au3> #include <array.au3> #include ".\Includes\AccVarsUtilities.au3" Global Const $sCLSID_App = "{86541CE9-EA39-4175-B37A-FDAE655AD30C}" Global Const $sIID_IScripRTD = "{EC0E6191-DB51-11D3-8F3E-00C04F3651B8}" Global Const $sIID_IRTDUpdateEvent = "{A43788C1-D91B-11D3-8F39-00C04F3651B8}" Global Const $tagIUnknown = "QueryInterface hresult(ptr;ptr*);" & _ "AddRef dword();" & _ "Release dword();" Global Const $tagIDispatch = $tagIUnknown & _ "GetTypeInfoCount hresult(dword*);" & _ "GetTypeInfo hresult(dword;dword;ptr*);" & _ "GetIDsOfNames hresult(struct*;struct*;dword;dword;struct*);" & _ "Invoke hresult(uint;struct*;dword;word;struct*;struct*;ptr;uint*);" Global Const $tagIScripRTD = $tagIDispatch & _ "ServerStart hresult(ptr;long*);" & _ "ConnectData hresult(long;ptr*;bool*;variant*);" & _ "RefreshData hresult(long*;ptr*);" & _ "DisconnectData hresult(long);" & _ "Heartbeat hresult(long*);" & _ "ServerTerminate hresult();" Global Const $tag_IRTDUpdateEvent = $tagIDispatch & _ "UpdateNotify hresult();" & _ "get_HeartbeatInterval hresult(long);" & _ "put_HeartbeatInterval hresult(long*);" & _ "Disconnect hresult();" Global Const $sIID_IUnknown = "{00000000-0000-0000-C000-000000000046}" Global $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") Global $g_oApp_ObjCast=0 _Test() Func _Test() Local $oApp_Obj = ObjCreateInterface($sCLSID_App, $sIID_IScripRTD) ConsoleWrite("IsObj($oApp_Obj): " & IsObj($oApp_Obj) & @CRLF) $g_oApp_ObjCast = ObjCreateInterface($oApp_Obj, $sIID_IScripRTD, $tagIScripRTD, False) ConsoleWrite("IsObj($g_oApp_ObjCast): " & IsObj($g_oApp_ObjCast) & @CRLF) Local $tIRTDUpdateEvents Local $ooIRTDUpdateEvents = ObjectFromTag("IRTDUpdateEvent_", $tag_IRTDUpdateEvent, $tIRTDUpdateEvents, False, False, $sIID_IRTDUpdateEvent) ConsoleWrite("IsObj($ooIRTDUpdateEvents): " & IsObj($ooIRTDUpdateEvents) & @CRLF) Local $pooIRTDUpdateEvents = $ooIRTDUpdateEvents() ConsoleWrite("$iHeartbeat: " & $oApp_Obj.Heartbeat() & @CRLF) Local $iHeartbeat = 0 $g_oApp_ObjCast.Heartbeat($iHeartbeat) ConsoleWrite("$iHeartbeat: " & $iHeartbeat & @CRLF) Local $iServerStatus = 0 ;~ $oApp_Obj.ServerStart($prt_IUnknown) ;this will fail $g_oApp_ObjCast.ServerStart($pooIRTDUpdateEvents, $iServerStatus) ConsoleWrite("$iHeartbeat: " & $iHeartbeat & @CRLF) Local $iTopidId = 0 Local $aStrings[] = ["test"] Local $pSafeArrayStrings AccVars_ArrayToSafeArray($aStrings, $pSafeArrayStrings) Local $bBool = True Local $aVariant = 0 $g_oApp_ObjCast.ConnectData($iTopidId, $pSafeArrayStrings, $bBool, $aVariant) ConsoleWrite("$iTopidId: " & $iTopidId & @CRLF) ConsoleWrite("$aStrings: " & IsArray($aStrings) & @CRLF) ConsoleWrite("$bBool: " & $bBool & @CRLF) ConsoleWrite("$aVariant: " & $aVariant & @CRLF) Local $aStringsData[0] Local $pSafeArrayData While Sleep(30) ;~ AccVars_ArrayToSafeArray($aStringsData, $pSafeArrayData) ;~ $g_oApp_ObjCast.RefreshData($iTopidId, $pSafeArrayData) ;~ AccVars_SafeArrayToArray($pSafeArrayData, $aStringsData) ;~ _ArrayDisplay($aStringsData) WEnd EndFunc ;==>_Test ;;============= Func IRTDUpdateEvent_UpdateNotify($pSelf) ConsoleWrite('> UpdateNotify: ' & @CRLF) Local $aStringsData[0] Local $pSafeArrayData AccVars_ArrayToSafeArray($aStringsData, $pSafeArrayData) $g_oApp_ObjCast.RefreshData(0, $pSafeArrayData) AccVars_SafeArrayToArray($pSafeArrayData, $aStringsData) ConsoleWrite(_ArrayToString($aStringsData) & @CRLF) Return $S_OK EndFunc ;==>IRTDUpdateEvent_UpdateNotify Func IRTDUpdateEvent_GetHeartbeatInterval($pSelf, $pvalue) Local $S_result = 0 ConsoleWrite('> $S_result: ' & $S_result & @CRLF) Return $S_result EndFunc ;==>IRTDUpdateEvent_GetHeartbeatInterval Func IRTDUpdateEvent_PutHeartbeatInterval($pSelf, $pvalue) ConsoleWrite('> $pvalue: ' & $pvalue & @CRLF) Return $S_OK EndFunc ;==>IRTDUpdateEvent_PutHeartbeatInterval Func IRTDUpdateEvent_Disconnect($pSelf) Return $S_OK EndFunc ;==>IRTDUpdateEvent_Disconnect Func IRTDUpdateEvent_QueryInterface($pSelf, $pRIID, $pObj) Local $sIID = StringFromGUID($pRIID) If $sIID = $sIID_IUnknown Then DllStructSetData(DllStructCreate("ptr", $pObj), 1, $pSelf) Return $S_OK ElseIf $sIID = $sIID_IRTDUpdateEvent Then DllStructSetData(DllStructCreate("ptr", $pObj), 1, $pSelf) Return $S_OK Else Return $E_NOINTERFACE EndIf EndFunc ;==>IRTDUpdateEvent_QueryInterface Func IRTDUpdateEvent_AddRef($pSelf) ConsoleWrite('> AddRef: ' & @CRLF) Return 1 EndFunc ;==>IRTDUpdateEvent_AddRef Func IRTDUpdateEvent_Release($pSelf) ConsoleWrite('> Release: ' & @CRLF) Return 1 EndFunc ;==>IRTDUpdateEvent_Release ;;============= Func IRTDUpdateEvent_GetTypeInfoCount($pSelf) ; Ret: long Par: ptr EndFunc ;==>IRTDUpdateEvent_GetTypeInfoCount Func IRTDUpdateEvent_GetTypeInfo($pSelf) ; Ret: long Par: dword;dword;ptr EndFunc ;==>IRTDUpdateEvent_GetTypeInfo Func IRTDUpdateEvent_GetIDsOfNames($pSelf) ; Ret: long Par: ptr;ptr;dword;dword;ptr EndFunc ;==>IRTDUpdateEvent_GetIDsOfNames Func IRTDUpdateEvent_Invoke($pSelf) ; Ret: long Par: uint;ptr;dword;word;ptr;ptr;ptr;ptr EndFunc ;==>IRTDUpdateEvent_Invoke Func StringFromGUID($pGUID) Local $aResult = DllCall("ole32.dll", "int", "StringFromGUID2", "struct*", $pGUID, "wstr", "", "int", 40) If @error Then Return SetError(@error, @extended, "") Return SetExtended($aResult[0], $aResult[2]) EndFunc ;==>StringFromGUID ;;-------- ;;-------- Func ObjectFromTag($sFunctionPrefix, $tagInterface, ByRef $tInterface, $fPrint = False, $bIsUnknown = Default, $sIID = "{00000000-0000-0000-C000-000000000046}") ; last param is IID_IUnknown by default If $bIsUnknown = Default Then $bIsUnknown = True Local $sInterface = $tagInterface ; copy interface description Local $tagIUnknown = "QueryInterface hresult(ptr;ptr*);" & _ "AddRef dword();" & _ "Release dword();" ; Adding IUnknown methods If $bIsUnknown Then $tagInterface = $tagIUnknown & $tagInterface ; Below line is really simple even though it looks super complex. It's just written weird to fit in one line, not to steal your attention Local $aMethods = StringSplit(StringReplace(StringReplace(StringReplace(StringReplace(StringTrimRight(StringReplace(StringRegExpReplace(StringRegExpReplace($tagInterface, "\w+\*", "ptr"), "\h*(\w+)\h*(\w+\*?)\h*(\((.*?)\))\h*(;|;*\z)", "$1\|$2;$4" & @LF), ";" & @LF, @LF), 1), "object", "idispatch"), "hresult", "long"), "bstr", "ptr"), "variant", "ptr"), @LF, 3) Local $iUbound = UBound($aMethods) Local $sMethod, $aSplit, $sNamePart, $aTagPart, $sTagPart, $sRet, $sParams, $hCallback ; Allocation $tInterface = DllStructCreate("int RefCount;int Size;ptr Object;ptr Methods[" & $iUbound & "];int_ptr Callbacks[" & $iUbound & "];ulong_ptr Slots[16]") ; 16 pointer sized elements more to create space for possible private props If @error Then Return SetError(1, 0, 0) For $i = 0 To $iUbound - 1 $aSplit = StringSplit($aMethods[$i], "|", 2) If UBound($aSplit) <> 2 Then ReDim $aSplit[2] $sNamePart = $aSplit[0] $sTagPart = $aSplit[1] $sMethod = $sFunctionPrefix & $sNamePart If $fPrint Then Local $iPar = StringInStr($sTagPart, ";", 2), $t If $iPar Then $t = "Ret: " & StringLeft($sTagPart, $iPar - 1) & " " & _ "Par: " & StringRight($sTagPart, StringLen($sTagPart) - $iPar) Else $t = "Ret: " & $sTagPart EndIf Local $s = "Func " & $sMethod & _ "( $pSelf ) ; " & $t & @CRLF & _ "EndFunc" & @CRLF ConsoleWrite($s) EndIf $aTagPart = StringSplit($sTagPart, ";", 2) $sRet = $aTagPart[0] $sParams = StringReplace($sTagPart, $sRet, "", 1) $sParams = "ptr" & $sParams $hCallback = DllCallbackRegister($sMethod, $sRet, $sParams) If @error Then ConsoleWrite('! ' & @error & ' ' & $sMethod & @CRLF & @CRLF) EndIf DllStructSetData($tInterface, "Methods", DllCallbackGetPtr($hCallback), $i + 1) ; save callback pointer DllStructSetData($tInterface, "Callbacks", $hCallback, $i + 1) ; save callback handle Next DllStructSetData($tInterface, "RefCount", 1) ; initial ref count is 1 DllStructSetData($tInterface, "Size", $iUbound) ; number of interface methods DllStructSetData($tInterface, "Object", DllStructGetPtr($tInterface, "Methods")) ; Interface method pointers Return ObjCreateInterface(DllStructGetPtr($tInterface, "Object"), $sIID, $sInterface, $bIsUnknown) ; pointer that's wrapped into object EndFunc ;==>ObjectFromTag ;;-------- ; #FUNCTION# ============================================================================= ; Name...........: _ErrFunc() ; ======================================================================================== ; User's COM error function. Will be called if COM error occurs #forceref $oErrorHandler Func _ErrFunc($oError) ; Do anything here. ConsoleWrite(@ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & @CRLF & _ @TAB & "err.number is: " & @TAB & @TAB & "0x" & Hex($oError.number) & @CRLF & _ @TAB & "err.windescription:" & @TAB & $oError.windescription & @CRLF & _ @TAB & "err.description is: " & @TAB & $oError.description & @CRLF & _ @TAB & "err.source is: " & @TAB & @TAB & $oError.source & @CRLF & _ @TAB & "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ @TAB & "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ @TAB & "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ @TAB & "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ @TAB & "err.retcode is: " & @TAB & "0x" & Hex($oError.retcode) & @CRLF & @CRLF) EndFunc ;==>_ErrFunc PD: Make sure to add #include ".\Includes\AccVarsUtilities.au3" It's from our dear user @LarsJ from here. Saludos2 points
-
https://www.autoitscript.com/autoit3/files/beta/autoit/ https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.15.3.zip1 point
-
Excel activate the 1000 separator
kawumm3000 reacted to Danp2 for a topic
Maybe this prior discussion will help you --1 point -
How to use the WinGetText?
Musashi reacted to FrancescoDiMuro for a topic
@natang Then you need to look at File* functions, especially FileOpen, FileWrite, and FileClose. Then, if you already tried something, please post your script, so we can help you from there1 point -
[Solved] Excel RangeRead Help with sheet name selection
AnonymousX reacted to water for a topic
Try: #include <MsgBoxConstants.au3> #include <Excel.au3> $sFolderpath = @ScriptDir & "\test.xlsm" Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_ICONERROR, "Error", "Error when starting Excel. @error=" & @error & ", @extended=" & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, $sFolderpath) If @error Then Exit MsgBox($MB_ICONERROR, "Error", "Error when opening workbook. @error=" & @error & ", @extended=" & @extended) Local $aData = _Excel_RangeRead($oWorkbook, "Data") If @error Then Exit MsgBox($MB_ICONERROR, "Error", "Error reading data - version 1. @error=" & @error & ", @extended=" & @extended) _ArrayDisplay($aData, "_Excel_RangeRead - Version 1") Local $aData = _Excel_RangeRead($oWorkbook, "Data", Default, 1, True) If @error Then Exit MsgBox($MB_ICONERROR, "Error", "Error reading data - version 2. @error=" & @error & ", @extended=" & @extended) _ArrayDisplay($aData, "_Excel_RangeRead - Version 2") MsgBox($MB_ICONINFORMATION, "Information", "Done")1 point -
[Solved] Excel RangeRead Help with sheet name selection
FrancescoDiMuro reacted to AnonymousX for a topic
No errors occur so not sure what to check. I have _Arraydisplay($array) being used and it just seems to skip that line in the code. So I know something isn't working but I'm not sure what. I tried testing with other sheet names and no luck either. Also thought it funny that I tried searching for how to check errors and your forum from 4 years ago came up.1 point -
Thank you @TheSaint Sorry for the mistake, I have reported as you have advised.1 point
-
Really rusty user needs help
FrancescoDiMuro reacted to TheXman for a topic
I seriously doubt that a function that read a cell and a function that has the ability to read a range (cell or a range of cells) is a "direct" parameter-for-parameter replacement. The same would be true for an old function that wrote a cell. To find out the differences, you will need to find definitions of the old functions and compare them to the current functions. You can probably get an old version with that help file from here: https://www.autoitscript.com/autoit3/files/archive/autoit/. You also may be able to download and install that old version and get your script running again as-is. What, am I supposed to guess the error that you're getting? Which debugger? There are several debuggers available. Hopefully you are starting to understand that to get better answers, you need to ask better questions.1 point -
Try this : $oIE = _IECreate(......) $oDiv2 = _IEGetObjById($oIE, "tab4-2") If Not IsObj($oDiv2) Then Exit MsgBox($MB_SYSTEMMODAL, "", "not an object") $objs = _IETagNameGetCollection($oDiv2, "div") For $obj In $objs If $obj.title = "Cayman Islands - George Town" Then _IEAction($obj, "click") _IELoadWait($oIE, 2000) ExitLoop EndIf Next1 point