Randall_j Posted June 27, 2016 Share Posted June 27, 2016 It looks very powerful Link to comment Share on other sites More sharing options...
Trolleule Posted October 14, 2016 Share Posted October 14, 2016 For those who were trying to display an array with _ArrayDisplay(): $cPrivacy_sum.Details = $aSummaryDetails ; simply do _ArrayDisplay(($cPrivacy_sum.Details)) Xandy and Busti 2 Link to comment Share on other sites More sharing options...
Andreik Posted July 25, 2017 Share Posted July 25, 2017 I was playing with default method of an object but I have a situation and I not sure what is wrong. What I am missing? expandcollapse popup#include-once #include <AutoItObject.au3> _AutoItObject_Startup() $obj = Obj1() $obj.ClickMe() ; <<-- works fine $obj.Something.Dummy() ; <<-- also works fine ;$obj.Something("New") <<--- why this line fails? $obj2 = Obj2() $obj2("New").ClickMe() ; <<-- and this one does not Func Obj1() Local $oClass = _AutoItObject_Class() With $oClass .AddMethod("ClickMe", "__obj1_clickme") .AddProperty("Something", $ELSCOPE_READONLY, Obj2()) EndWith Return $oClass.Object EndFunc Func Obj2() Local $oClass = _AutoItObject_Class() With $oClass .AddMethod("__default__", "__default_object2_") .AddMethod("Dummy", "__obj2_clickme") .AddProperty("Object", $ELSCOPE_READONLY, Null) .AddProperty("Name", $ELSCOPE_READONLY, Null) EndWith Return $oClass.Object EndFunc Func Obj3() Local $oClass = _AutoItObject_Class() With $oClass .AddMethod("ClickMe", "__obj3_clickme") EndWith Return $oClass.Object EndFunc Func __default_object2_($oSelf, $sName) #forceref $oSelf If $oSelf.Object = Null Then $oSelf.Object = Obj3() $oSelf.Name = $sName Return $oSelf.Object EndFunc Func __obj1_clickme($oSelf) ConsoleWrite('clickme1' & @crlf) EndFunc Func __obj2_clickme($oSelf) ConsoleWrite('clickme2' & @crlf) EndFunc Func __obj3_clickme($oSelf) ConsoleWrite('clickme3' & @crlf) EndFunc Link to comment Share on other sites More sharing options...
jaberwacky Posted July 26, 2017 Share Posted July 26, 2017 (edited) For Obj1, Something is a readonly property. I think you'll have to make it a method. Right? Been awhile since I did any coding. Scratch that. Edited July 26, 2017 by jaberwacky Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
jaberwacky Posted July 26, 2017 Share Posted July 26, 2017 Would this basically achieve the same objective? $obj.Something.New("NewThing") Func Obj1() Local $oClass = _AutoItObject_Class() With $oClass .AddMethod("ClickMe", "__obj1_clickme") .AddMethod("New", "__obj1_new") .AddProperty("Something", $ELSCOPE_READONLY, Obj2()) EndWith Return $oClass.Object EndFunc Func __obj1_new() ; ... new thing stuff EndFunc Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
CosmicDan Posted January 3, 2018 Share Posted January 3, 2018 (edited) People still using AIO these days? Any new performance or stability issues? I think I'm going to convert my project to it. I did find that it wasn't working in Windows 10 x64 (unless using the 32-bit wrapper) but I found a v1.2.8.3 fork which works Edited January 3, 2018 by JonusC CosmicDan.com Link to comment Share on other sites More sharing options...
junkew Posted January 3, 2018 Share Posted January 3, 2018 Alternatives FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
CosmicDan Posted January 4, 2018 Share Posted January 4, 2018 5 hours ago, junkew said: Alternatives I did see that, but I think it's useless when class properties can't even be strings. I've opted to recreate my tool in an "OOP-like" paradigm as previously described by guinness. It's good enough - I mostly just wanted a basic level of encapsulation, even if it's only pretending to be. CosmicDan.com Link to comment Share on other sites More sharing options...
Andreik Posted May 23, 2018 Share Posted May 23, 2018 I have the following object with a property that will store an array. This script work as I expected when I call Add method but crash when I call Destroy method. Functions __add and __destroy have a very similar code I obviously I can't see where the problem is. Even if I comment the line where I redimension the array or if I create a new array when I call Destroy method the script will crash. Some ideas why? #include <AutoItObject.au3> #include <Array.au3> _AutoItObject_Startup() $oTest = Test() $oTest.Add('Test1') $aObjects = $oTest.Objects _ArrayDisplay($aObjects) $oTest.Add('Test2') $aObjects = $oTest.Objects _ArrayDisplay($aObjects) $oTest.Destroy Func Test() Local $aObjects[1] $oTest = _AutoItObject_Class() With $oTest .AddMethod('Destroy','__destory') .AddMethod('Add','__add') .AddProperty('Objects', $ELSCOPE_PUBLIC, $aObjects) EndWith Return $oTest.Object EndFunc Func __add($oThis, $Name) Local $aObjects = $oThis.Objects _ArrayAdd($aObjects,$Name) $oThis.Objects = $aObjects EndFunc Func __destroy($oThis) Local $aObjects = $oThis.Objects ReDim $aObjects[1] $oThis.Objects = $aObjects EndFunc Link to comment Share on other sites More sharing options...
water Posted May 23, 2018 Share Posted May 23, 2018 It's always a good idea to post all error messages you get My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Andreik Posted May 23, 2018 Share Posted May 23, 2018 (edited) The requested action with this object has failed.: $oTest.Destroy $oTest^ ERROR Edit: I see where the problem is, a typo in function name Edited May 23, 2018 by Andreik Link to comment Share on other sites More sharing options...
water Posted May 23, 2018 Share Posted May 23, 2018 I suggest to add a COM error handler. This gives us more detailed error information. An example can be found in the help file for ObjEvent. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Andreik Posted May 23, 2018 Share Posted May 23, 2018 I know, but in this case the handler gave me same error so I didn't included in my posted script for a better read. Link to comment Share on other sites More sharing options...
water Posted May 23, 2018 Share Posted May 23, 2018 I see My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jaberwacky Posted June 3, 2018 Share Posted June 3, 2018 Typo: .AddMethod('Destroy','__destory') Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
water Posted June 3, 2018 Share Posted June 3, 2018 Andreik already noticed on 23th of May what caused th problem Quote Edit: I see where the problem is, a typo in function name My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
jaberwacky Posted June 3, 2018 Share Posted June 3, 2018 Oops, I'm a doofus. It also occurred to me too late that I was replying to old news. Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
TisButAFleshWound Posted June 18, 2020 Share Posted June 18, 2020 Can someone point me in the right direction? I've just stumbled upon AutoIt Object when looking for a way to take full webpage screenshots. The solution I found has AutoIt Object as a pre-requisite. However, I'm struggling to find a way in. I've got the AutoItObject.au3 file in the include folder but I can't find any instructions on what other files from the download package go where. The screenshot code is currently failing to compile with _AutoItObject_WarpInterface(): undefined function. Any pointers on where to look for guidance on how to install would be appreciated Link to comment Share on other sites More sharing options...
Andreik Posted June 18, 2020 Share Posted June 18, 2020 (edited) I don't know if this function is included in AutoItObject UDF but this is what are you looking for, just add it in your script: Func _AutoItObject_WarpInterface($Obj, $IID, $Tag, $fNoUnknown = False) If Not IsDllStruct($IID) Then $IID = _AutoItObject_CLSIDFromString($IID) If Not IsObj($Obj) Then Return SetError(1, 0, 0) Local $pObj = _AutoItObject_IDispatchToPtr($Obj) If Not _AutoItObject_IUnknownAddRef($Obj) Then Return SetError(1, 0, 0) Local $ObjWarpped = _AutoItObject_WrapperCreate($pObj, $dtagIUnknown, $fNoUnknown) Local $aCall = $ObjWarpped.QueryInterface(Number(DllStructGetPtr($IID)), 0) If Not IsArray($aCall) And $aCall[0] <> 0 Then Return SetError(1, 0, 0) Local $pInterface = $aCall[2] Return _AutoItObject_WrapperCreate($pInterface, $Tag) EndFunc ;==>_AutoItObject_WarpInterface Edited June 18, 2020 by Andreik Link to comment Share on other sites More sharing options...
TisButAFleshWound Posted June 19, 2020 Share Posted June 19, 2020 That solved the problem, many thanks Andreik 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