jaberwacky Posted July 25, 2013 Share Posted July 25, 2013 It's an autoit thing I'm pretty sure because try this too. #include-once #include "AutoItObject.au3" _AutoItObject_StartUp() Global $this = _AutoItObject_Class() $this.AddProperty("E", $elscope_readonly, '~') ConsoleWrite($this.Object.E & @CRLF) _AutoItObject_Shutdown() E being used for exponents. trancexx 1 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...
LateArrival Posted July 26, 2013 Share Posted July 26, 2013 Question to the authors of this UDF: Given some of the functionality being released in the more recent AU3 betas. Are there any plans to further enhance this UDF? Link to comment Share on other sites More sharing options...
Kip Posted July 26, 2013 Share Posted July 26, 2013 Question to the authors of this UDF: Given some of the functionality being released in the more recent AU3 betas. Are there any plans to further enhance this UDF? I have pm'ed the others two weeks ago. No one replied so far. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
UberFoX Posted August 22, 2013 Share Posted August 22, 2013 (edited) Classes are great I like the idea you got there I view classes as fundamental. What about adding your own modifications to the text editor that AutoIt uses so you can create stuff like: Class MessageBox Local $Text; Local $Title; Local $Opt; Func Construct() // whateva.... EndFunc Func Destruct() // free stuff whateva.... EndFunc Func Call($Title, $Text, $Opt) $self.$Title= $Title $self.$Text = $Text $self.$Opt= $Opt return dllcall() ; bla bla EndFunc EndClass $var = new MessageBox("); $ret = $var.call("My title", "MyText", "myopt"); Basically it could use what you already have but make it MUCH easier to code and much more user friendly. The text editor could translate what I typed above into the appropriate strings and stuff before executing the script. Its just an idea... Edited August 22, 2013 by UberFoX Link to comment Share on other sites More sharing options...
FaridAgl Posted August 22, 2013 Share Posted August 22, 2013 I'm really sorry to see this project has been left behind. I'm still using it, enjoying it, and AutoIt should proud to itself for existence of AO. expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" #include <Array.au3> Func Account($sUsername, $sPassword = "", $sServers = "", $sAfkRoom = "", $sSpamWhisperRoom = "", $sExpiryDate = "", $sComments = "") If (Not FileExists(@ScriptDir & "\Databases")) Then DirCreate(@ScriptDir & "\Databases") Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("File", $ELSCOPE_PRIVATE, @ScriptDir & "\Databases\Accounts.ggm") .AddProperty("Username", $ELSCOPE_PRIVATE, $sUsername) .AddProperty("Password", $ELSCOPE_PRIVATE, $sPassword) .AddProperty("Servers", $ELSCOPE_PRIVATE, $sServers) .AddProperty("AfkRoom", $ELSCOPE_PRIVATE, $sAfkRoom) .AddProperty("SpamWhisperRoom", $ELSCOPE_PRIVATE, $sSpamWhisperRoom) .AddProperty("ExpiryDate", $ELSCOPE_PRIVATE, $sExpiryDate) .AddProperty("Comments", $ELSCOPE_PRIVATE, $sComments) #endregion Variables (Private) #region Methods (Public) .AddMethod("Add", "Account_Add") .AddMethod("Delete", "Account_Delete") .AddMethod("Array", "Account_Array") #endregion Methods (Public) #region Methods (Private) .AddMethod("Exists", "Account_Exists", True) .AddMethod("Read", "Account_Read", True) .AddMethod("Write", "Account_Write", True) .AddMethod("Encrypt", "Account_Encrypt", True) .AddMethod("Decrypt", "Account_Decrypt", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Account_Add($oSelf, $bOverwrite = False) If ((Not $oSelf.Exists()) Or ($bOverwrite)) Then $oSelf.Write($oSelf.Username, "Password", $oSelf.Password) $oSelf.Write($oSelf.Username, "Servers", $oSelf.Servers) $oSelf.Write($oSelf.Username, "AFK Room", $oSelf.AfkRoom) $oSelf.Write($oSelf.Username, "Spam/Whisper Room", $oSelf.SpamWhisperRoom) $oSelf.Write($oSelf.Username, "Expiry Date", $oSelf.ExpiryDate) $oSelf.Write($oSelf.Username, "Comments", $oSelf.Comments) Return True EndIf Return False EndFunc Func Account_Delete($oSelf) IniDelete($oSelf.File, $oSelf.Encrypt($oSelf.Username)) EndFunc Func Account_Array($oSelf) Local $aAccounts = IniReadSectionNames($oSelf.File) If (@error) Then Return For $i = 1 To $aAccounts[0] $aAccounts[$i] = $oSelf.Decrypt($aAccounts[$i]) Next _ArrayDelete($aAccounts, 0) Return $aAccounts EndFunc #endregion Methods (Public) #region Methods (Private) Func Account_Exists($oSelf) Return IsArray(IniReadSection($oSelf.File, $oSelf.Encrypt($oSelf.Username))) EndFunc Func Account_Read($oSelf, $sSection, $sKey) Return $oSelf.Decrypt(IniRead($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), "")) EndFunc Func Account_Write($oSelf, $sSection, $sKey, $sValue) If ($sValue) Then IniWrite($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), $oSelf.Encrypt($sValue)) Else IniDelete($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey)) EndIf EndFunc Func Account_Encrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = StringToBinary($sInput) $sOutput = StringTrimLeft($sOutput, 2) $sOutput = StringLower($sOutput) Return $sOutput EndFunc Func Account_Decrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = "0x" & $sInput $sOutput = BinaryToString($sOutput) Return $sOutput EndFunc #endregion Methods (Private) expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" #include <MsgBoxConstants.au3> Func Show() Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("Title", $ELSCOPE_PRIVATE, $oConstants.Title) #endregion Variables (Private) #region Methods (Public) .AddMethod("Error", "Show_Error") .AddMethod("Information", "Show_Information") .AddMethod("Question", "Show_Question") .AddMethod("Warning", "Show_Warning") #endregion Methods (Public) #region Methods (Private) .AddMethod("GetParent", "Show_GetParent", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Show_Error($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONHAND), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc Func Show_Information($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONASTERISK), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc Func Show_Question($oSelf, $sText, $oParent = 0, $bSecondButton = False) Local $uFlag = BitOR($MB_YESNO, $MB_ICONQUESTION) If ($bSecondButton) Then $uFlag = BitOR($uFlag, $MB_DEFBUTTON2) Return (MsgBox($uFlag, $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) = $IDYES) EndFunc Func Show_Warning($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONEXCLAMATION), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc #endregion Methods (Public) #region Methods (Private) Func Show_GetParent($oSelf, $oParent) #forceref $oSelf Return (IsObj($oParent)) ? ($oParent.Handle) : (0) EndFunc #endregion Methods (Private) expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" Func Settings() If (Not FileExists(@ScriptDir & "\Databases")) Then DirCreate(@ScriptDir & "\Databases") Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("File", $ELSCOPE_PRIVATE, @ScriptDir & "\Databases\Settings.ggm") #endregion Variables (Private) #region Methods (Public) .AddMethod("Username", "Settings_Username") .AddMethod("Password", "Settings_Password") .AddMethod("LogInAutomatically", "Settings_LogInAutomatically") #endregion Methods (Public) #region Methods (Private) .AddMethod("Read", "Settings_Read", True) .AddMethod("Write", "Settings_Write", True) .AddMethod("Encrypt", "Settings_Encrypt", True) .AddMethod("Decrypt", "Settings_Decrypt", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Settings_Username($oSelf, $sUsername = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Username", $sUsername) Else Return $oSelf.Read("Login", "Username") EndIf EndFunc Func Settings_Password($oSelf, $sPassword = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Password", $sPassword) Else Return $oSelf.Read("Login", "Password") EndIf EndFunc Func Settings_LogInAutomatically($oSelf, $sLogInAutomatically = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Log in Automatically", $sLogInAutomatically) Else Return $oSelf.Read("Login", "Log in Automatically") EndIf EndFunc #endregion Methods (Public) #region Methods (Private) Func Settings_Read($oSelf, $sSection, $sKey) Return $oSelf.Decrypt(IniRead($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), "")) EndFunc Func Settings_Write($oSelf, $sSection, $sKey, $sValue) If ($sValue) Then IniWrite($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), $oSelf.Encrypt($sValue)) Else IniDelete($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey)) EndIf EndFunc Func Settings_Encrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = StringToBinary($sInput) $sOutput = StringTrimLeft($sOutput, 2) $sOutput = StringLower($sOutput) Return $sOutput EndFunc Func Settings_Decrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = "0x" & $sInput $sOutput = BinaryToString($sOutput) Return $sOutput EndFunc #endregion Methods (Private) OO support in AutoIt would be great, However AO is still good but not enough. http://faridaghili.ir Link to comment Share on other sites More sharing options...
UEZ Posted August 22, 2013 Share Posted August 22, 2013 Is there any good tutorial available for AutoItObject? To learn from some code examples might be a problem to get in touch with it. It would be great to introduce oop with examples in a more details way than it is currently.Maybe then more people will learn new things.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
FaridAgl Posted August 22, 2013 Share Posted August 22, 2013 (edited) <snip> UEZ,The OO features and concepts remains same for all programming languages, there are only some differences in syntax based on the programming language you are using. you can start studying it from available tutorials for C#, VB or C++:http://en.wikipedia.org/wiki/Object-oriented_programminghttp://msdn.microsoft.com/en-us/library/vstudio/dd460654.aspxhttp://www.cplusplus.com/doc/tutorial/classes/http://www.cplusplus.com/doc/tutorial/classes2/ Then taking a look at AO UDF's documentation will do the rest. Edited August 23, 2013 by Melba23 http://faridaghili.ir Link to comment Share on other sites More sharing options...
Administrators Jon Posted August 23, 2013 Administrators Share Posted August 23, 2013 Topic split and reopened. Stay. On. Topic. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
trancexx Posted August 23, 2013 Share Posted August 23, 2013 I'm really sorry to see this project has been left behind. I'm still using it, enjoying it, and AutoIt should proud to itself for existence of AO. expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" #include <Array.au3> Func Account($sUsername, $sPassword = "", $sServers = "", $sAfkRoom = "", $sSpamWhisperRoom = "", $sExpiryDate = "", $sComments = "") If (Not FileExists(@ScriptDir & "\Databases")) Then DirCreate(@ScriptDir & "\Databases") Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("File", $ELSCOPE_PRIVATE, @ScriptDir & "\Databases\Accounts.ggm") .AddProperty("Username", $ELSCOPE_PRIVATE, $sUsername) .AddProperty("Password", $ELSCOPE_PRIVATE, $sPassword) .AddProperty("Servers", $ELSCOPE_PRIVATE, $sServers) .AddProperty("AfkRoom", $ELSCOPE_PRIVATE, $sAfkRoom) .AddProperty("SpamWhisperRoom", $ELSCOPE_PRIVATE, $sSpamWhisperRoom) .AddProperty("ExpiryDate", $ELSCOPE_PRIVATE, $sExpiryDate) .AddProperty("Comments", $ELSCOPE_PRIVATE, $sComments) #endregion Variables (Private) #region Methods (Public) .AddMethod("Add", "Account_Add") .AddMethod("Delete", "Account_Delete") .AddMethod("Array", "Account_Array") #endregion Methods (Public) #region Methods (Private) .AddMethod("Exists", "Account_Exists", True) .AddMethod("Read", "Account_Read", True) .AddMethod("Write", "Account_Write", True) .AddMethod("Encrypt", "Account_Encrypt", True) .AddMethod("Decrypt", "Account_Decrypt", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Account_Add($oSelf, $bOverwrite = False) If ((Not $oSelf.Exists()) Or ($bOverwrite)) Then $oSelf.Write($oSelf.Username, "Password", $oSelf.Password) $oSelf.Write($oSelf.Username, "Servers", $oSelf.Servers) $oSelf.Write($oSelf.Username, "AFK Room", $oSelf.AfkRoom) $oSelf.Write($oSelf.Username, "Spam/Whisper Room", $oSelf.SpamWhisperRoom) $oSelf.Write($oSelf.Username, "Expiry Date", $oSelf.ExpiryDate) $oSelf.Write($oSelf.Username, "Comments", $oSelf.Comments) Return True EndIf Return False EndFunc Func Account_Delete($oSelf) IniDelete($oSelf.File, $oSelf.Encrypt($oSelf.Username)) EndFunc Func Account_Array($oSelf) Local $aAccounts = IniReadSectionNames($oSelf.File) If (@error) Then Return For $i = 1 To $aAccounts[0] $aAccounts[$i] = $oSelf.Decrypt($aAccounts[$i]) Next _ArrayDelete($aAccounts, 0) Return $aAccounts EndFunc #endregion Methods (Public) #region Methods (Private) Func Account_Exists($oSelf) Return IsArray(IniReadSection($oSelf.File, $oSelf.Encrypt($oSelf.Username))) EndFunc Func Account_Read($oSelf, $sSection, $sKey) Return $oSelf.Decrypt(IniRead($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), "")) EndFunc Func Account_Write($oSelf, $sSection, $sKey, $sValue) If ($sValue) Then IniWrite($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), $oSelf.Encrypt($sValue)) Else IniDelete($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey)) EndIf EndFunc Func Account_Encrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = StringToBinary($sInput) $sOutput = StringTrimLeft($sOutput, 2) $sOutput = StringLower($sOutput) Return $sOutput EndFunc Func Account_Decrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = "0x" & $sInput $sOutput = BinaryToString($sOutput) Return $sOutput EndFunc #endregion Methods (Private) expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" #include <MsgBoxConstants.au3> Func Show() Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("Title", $ELSCOPE_PRIVATE, $oConstants.Title) #endregion Variables (Private) #region Methods (Public) .AddMethod("Error", "Show_Error") .AddMethod("Information", "Show_Information") .AddMethod("Question", "Show_Question") .AddMethod("Warning", "Show_Warning") #endregion Methods (Public) #region Methods (Private) .AddMethod("GetParent", "Show_GetParent", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Show_Error($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONHAND), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc Func Show_Information($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONASTERISK), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc Func Show_Question($oSelf, $sText, $oParent = 0, $bSecondButton = False) Local $uFlag = BitOR($MB_YESNO, $MB_ICONQUESTION) If ($bSecondButton) Then $uFlag = BitOR($uFlag, $MB_DEFBUTTON2) Return (MsgBox($uFlag, $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) = $IDYES) EndFunc Func Show_Warning($oSelf, $sText, $oParent = 0) MsgBox(BitOR($MB_OK, $MB_ICONEXCLAMATION), $oSelf.Title, $sText, 0, $oSelf.GetParent($oParent)) EndFunc #endregion Methods (Public) #region Methods (Private) Func Show_GetParent($oSelf, $oParent) #forceref $oSelf Return (IsObj($oParent)) ? ($oParent.Handle) : (0) EndFunc #endregion Methods (Private) expandcollapse popup#include-once #include "..\Libraries\AutoItObject.au3" Func Settings() If (Not FileExists(@ScriptDir & "\Databases")) Then DirCreate(@ScriptDir & "\Databases") Local $oClass = _AutoItObject_Class() With $oClass #region Variables (Private) .AddProperty("File", $ELSCOPE_PRIVATE, @ScriptDir & "\Databases\Settings.ggm") #endregion Variables (Private) #region Methods (Public) .AddMethod("Username", "Settings_Username") .AddMethod("Password", "Settings_Password") .AddMethod("LogInAutomatically", "Settings_LogInAutomatically") #endregion Methods (Public) #region Methods (Private) .AddMethod("Read", "Settings_Read", True) .AddMethod("Write", "Settings_Write", True) .AddMethod("Encrypt", "Settings_Encrypt", True) .AddMethod("Decrypt", "Settings_Decrypt", True) #endregion Methods (Private) Return .Object EndWith EndFunc #region Methods (Public) Func Settings_Username($oSelf, $sUsername = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Username", $sUsername) Else Return $oSelf.Read("Login", "Username") EndIf EndFunc Func Settings_Password($oSelf, $sPassword = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Password", $sPassword) Else Return $oSelf.Read("Login", "Password") EndIf EndFunc Func Settings_LogInAutomatically($oSelf, $sLogInAutomatically = "") If (@NumParams = 2) Then $oSelf.Write("Login", "Log in Automatically", $sLogInAutomatically) Else Return $oSelf.Read("Login", "Log in Automatically") EndIf EndFunc #endregion Methods (Public) #region Methods (Private) Func Settings_Read($oSelf, $sSection, $sKey) Return $oSelf.Decrypt(IniRead($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), "")) EndFunc Func Settings_Write($oSelf, $sSection, $sKey, $sValue) If ($sValue) Then IniWrite($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey), $oSelf.Encrypt($sValue)) Else IniDelete($oSelf.File, $oSelf.Encrypt($sSection), $oSelf.Encrypt($sKey)) EndIf EndFunc Func Settings_Encrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = StringToBinary($sInput) $sOutput = StringTrimLeft($sOutput, 2) $sOutput = StringLower($sOutput) Return $sOutput EndFunc Func Settings_Decrypt($oSelf, $sInput) #forceref $oSelf If ($sInput = "") Then Return "" Local $sOutput = "0x" & $sInput $sOutput = BinaryToString($sOutput) Return $sOutput EndFunc #endregion Methods (Private) OO support in AutoIt would be great, However AO is still good but not enough. AutoItObject was more of an idea, and it was proof that things can be done differently and that the box some people live in is just a tiny part of much bigger programming space. And no, it's not the way how things should be done. This whole thing can be done much nicely by AutoIt internally but in order to do that you have to make AutoIt better, maybe even change it a bit. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
MrJustinMeyer Posted October 10, 2013 Share Posted October 10, 2013 I am using AutoIt to interface with an application via COM and have ran into a problem of a method using "ref" to return a value. From reading this thread and the AIO help file, I feel like I should be able to do this either in AU3 or AIO. See '?do=embed' frameborder='0' data-embedContent>> for specifics on what I am dealing with. Am I on the right track, or is AIO not a solution to getting "ref" (C#) and "ByRef" (VB) functionality in AutoIt. Link to comment Share on other sites More sharing options...
FaridAgl Posted October 30, 2013 Share Posted October 30, 2013 (edited) I have 2 problem/question: In the following code, the Child class doesn't inherits from the Parent class. I guess something is wrong with .Create method: expandcollapse popup#include "AutoItObject.au3" _AutoItObject_Startup() Global $b = Child() $b.Method() $b = 0 _AutoItObject_Shutdown() Func Parent() Local $oClass = _AutoItObject_Class() With $oClass .AddDestructor("Parent_Destructor") .AddProperty("Property", $ELSCOPE_PUBLIC, "Parent Property") .AddMethod("Method", "Parent_Method", False) EndWith Return $oClass.Object EndFunc Func Parent_Destructor($this) MsgBox(0, "", "Parent Destructor") EndFunc Func Parent_Method($this) MsgBox(0, "", $this.Property) EndFunc Func Child() Local $oClass = _AutoItObject_Class() With $oClass .Create(Parent()) EndWith Return $oClass.Object EndFunc How ever doing that in this way will fix the problem: #include "AutoItObject.au3" _AutoItObject_Startup() Global $b = Child() $b.Method() $b = 0 _AutoItObject_Shutdown() Func Parent() Local $oClass = _AutoItObject_Class() With $oClass .AddDestructor("Parent_Destructor") .AddProperty("Property", $ELSCOPE_PUBLIC, "Parent Property") .AddMethod("Method", "Parent_Method", False) EndWith Return $oClass.Object EndFunc Func Parent_Destructor($this) MsgBox(0, "", "Parent Destructor") EndFunc Func Parent_Method($this) MsgBox(0, "", $this.Property) EndFunc Func Child() Local $oClass = _AutoItObject_Create(Parent()) Return $oClass EndFunc But even in the second code, I think there is some problem. The Parent class's destructor gets called after creating the Child class. However it seems to be normal, but just want to ask, am I doing it in the right way? I'm using AutoItObject 1.2.8.2. Is there any newer version of AutoItObject? Or anything else that I should probably know? Thanks. Edited October 30, 2013 by D4RKON3 http://faridaghili.ir Link to comment Share on other sites More sharing options...
jaberwacky Posted October 30, 2013 Share Posted October 30, 2013 (edited) There is this way which I use a lot: Func child(Const $parent) Local $this = $parent _autoitobject_addmethod($this, "...", "...") Return $this EndFunc Edited October 30, 2013 by jaberwocky6669 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...
LarsJ Posted October 31, 2013 Share Posted October 31, 2013 D4RKON3, You can find AutoItObject 1.2.8.3 in post #302. Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
FaridAgl Posted October 31, 2013 Share Posted October 31, 2013 @jaberwocky6669, Thank you body, I have found another solution too. @LarsJm Thanks, I remember now! http://faridaghili.ir Link to comment Share on other sites More sharing options...
ellienn Posted February 21, 2014 Share Posted February 21, 2014 Thank you. Great job! But... can't download AutoItObject 1.2.8.2.exe mirror link is down also zip only... Link to comment Share on other sites More sharing options...
10031992 Posted March 6, 2014 Share Posted March 6, 2014 the link is out, would reup? -------------------------------------------------------------------------------------------------------------------------------------------- [center][/center][center]Autoit Support Forum in Portuguese | AutoitBrasil.com[/center] [sub]My Script :[/sub]Simples Login for Program Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 7, 2014 Share Posted March 7, 2014 The zip still works, download that. Or you download 1.2.8.3 from post >#302 .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
jaberwacky Posted July 10, 2014 Share Posted July 10, 2014 I have encountered an issue which I think is AutoItObject related if anybody is interested. If I use With/EndWith in the following code, the second parameter must be accessed using the full variable. The method sets the title of a window. The third commented line is why I think that this isn't an AutoIt issue as much as it is an AIO issue. The code should be self explanatory. This is just a silly reproducer I cooked up quickly. expandcollapse popup#include "AutoItObject.au3" #include <GUIConstantsEx.au3> _AutoItObject_StartUp() Const $gui_view = GUIView() With $gui_view .SetTitle(.Title1, .Title2) ; doesn't work .SetTitle(.Title1, $gui_view.Title2) ; works fine WinSetTitle(.GUI, '', .Title1 & ' ' & .Title2) ; also works fine .Show() EndWith Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _AutoItObject_Shutdown() Exit EndSwitch Until False Func GUIView() Local $this = _AutoItObject_Class() $this.AddMethod("SetTitle", "_setTitle") $this.AddMethod("Show", "_show") $this.AddProperty("GUI", $elscope_readonly, GUICreate("")) $this.AddProperty("Title1", $elscope_readonly, "Test1") $this.AddProperty("Title2", $elscope_readonly, "Test2") Return $this.Object EndFunc Func _setTitle(Const $this, Const $title1, Const $title2) WinSetTitle($this.GUI, '', $this.Title1 & ' ' & $this.Title2) EndFunc Func _show(Const $this) GUISetState(@SW_SHOWNORMAL, $this.GUI) EndFunc Is this something that can/will be fixed? 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...
FaridAgl Posted July 10, 2014 Share Posted July 10, 2014 The following snippet shows it's an AutoIt thing and nothing is wrong with AIO: Global $oDictionary = ObjCreate("Scripting.Dictionary") $oDictionary.Add("A", "Value of A") With $oDictionary MsgBox(0, .Count, $oDictionary.Item("A")) ;Doesn't fails MsgBox(0, .Count, .Item("A")) ;Fails MsgBox(0, $oDictionary.Count, .Item("A")) ;Fails too EndWith http://faridaghili.ir Link to comment Share on other sites More sharing options...
jaberwacky Posted July 10, 2014 Share Posted July 10, 2014 (edited) Interesting. Weird how this line works: WinSetTitle(.GUI, '', .Title1 & ' ' & .Title2) but you demonstrate in your example that it is an au3 issue after all. Guess I should file a bug report. Trac: http://www.autoitscript.com/trac/autoit/ticket/2789#ticket Edited July 10, 2014 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...
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