Jump to content

AutoItObject UDF


ProgAndy
 Share

Recommended Posts

Perfect, Origo is playing lunatic again, clicked on "download" and after 3 min of waiting was presented with:

* warning: Invalid argument supplied for foreach() in /var/lib/origo-web/drupal/sites/all/modules/origo_home/origo_releases.inc on line 417.
    * warning: usort() [function.usort]: The argument should be an array in /var/lib/origo-web/drupal/sites/all/modules/origo_home/origo_releases.inc on line 432.
    * warning: array_reverse() [function.array-reverse]: The argument should be an array in /var/lib/origo-web/drupal/sites/all/modules/origo_home/origo_releases.inc on line 442.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE 

Link to comment
Share on other sites

http://www.autoitscript.com/forum/index.php?app=downloads - This might be a more appropriate download location. I'm not sure how exactly it works, but I was able to upload a file that didn't count against my personal attachment quota.

Link to comment
Share on other sites

http://www.autoitscript.com/forum/index.php?app=downloads - This might be a more appropriate download location. I'm not sure how exactly it works, but I was able to upload a file that didn't count against my personal attachment quota.

Thanks to the stability of origo, I added our library there, too.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Thanks to the stability of origo, I added our library there, too.

Unfortunately Downloads section doesn't seem to be attended very well: it takes weeks before a submission is approved or rejected.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE 

Link to comment
Share on other sites

Unfortunately Downloads section doesn't seem to be attended very well: it takes weeks before a submission is approved or rejected.

OK. Added another mirror ...

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Btw, I must not forget to say thanks to doudou for acting very inspirational regarding _AutoItObject_DllStructCreate() function.

So, thanks mister :)

Always a pleasure.

I managed to download the release now. One little feature in _AutoItObject_DllStructCreate() is missing :idea: - the easy way to get pointer to an element like $aioStruct.GetPtr($element). Shall I add it to the tracker?

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE 

Link to comment
Share on other sites

Thanks for the update, not that i understand all the DLLStruct-Object part off it , but its great to be able to script in a oop like way.

GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF.
Link to comment
Share on other sites

Thanks for the update, not that i understand all the DLLStruct-Object part off it , but its great to be able to script in a oop like way.

The beauty of it is that you need to know less than with normal DllStruct functions to comprehend more.

For example, classic code would be:

$tStructure = DllStructCreate("wchar String[44]")
DllStructSetData($tStructure, "String", "This is the text to write to the structure.")
$sReadData = DllStructGetData($tStructure, "String")

ConsoleWrite($sReadData & @CRLF)

And with AutoitObject:

$oStructure = _AutoItObject_DllStructCreate("wchar String[44]")
$oStructure.String = "This is the text to write to the structure."
$sReadData = $oStructure.String

ConsoleWrite($sReadData & @CRLF)

That's it.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Trancexx - That is beautiful. Quite literally. I think it might be worthwhile to start using AutoIt OO with Au3Irrlicht. Thanks guys!

Link to comment
Share on other sites

I just wanted to say that I got my first oop script working! I did just shamelessly use oMsgBoxObject.au3 practically as a template though. Anyways, I'm kinda excited, I might celebrate. Five stars!

Okies here's my code so far ... don't know how useful something like this would be but meh, whatever:

#AutoIt3Wrapper_AU3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -d

#include <AutoItObject.au3>
#include <GUIConstants.au3>

Global $oError = ObjEvent("Autoit.Error", "_myErrFunc")

_AutoItObject_StartUp()

Global $oObject = _GUICreator()

With $oObject
    .GUITitle = "HELLO!"
    .GUI()

    .ButtonText = "Click ME! =D"
    .ButtonTop = 100
    .ButtonLeft = 100
    Global $button = .Button()

    .ButtonText = "Click ME too!! =D"
    .ButtonTop = 150
    .ButtonLeft = 100
    Global $button1 = .Button()
EndWith

GUISetState()

While 1
    Sleep(50)

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button
            ToolTip("He's an imposter. I'm the real Dr. Livingston")
            Sleep(200)
        Case $button1
            ToolTip("NAHNAH Fooled you! =P")
            Sleep(200)
    EndSwitch
WEnd

$oObject = 0

Func _GUICreator()
    Local $oClassObject = _AutoItObject_Class()
    $oClassObject.Create()

    $oClassObject.AddMethod("GUI", "_GUI_Create")
    $oClassObject.AddProperty("GUITitle", $ELSCOPE_PUBLIC, "")
    $oClassObject.AddProperty("GUIWidth", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("GUIHeight", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("GUITop", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("GUILeft", $ELSCOPE_PUBLIC, -1)

    $oClassObject.AddMethod("Button", "_GUI_Button")
    $oClassObject.AddProperty("ButtonText", $ELSCOPE_PUBLIC, "")
    $oClassObject.AddProperty("ButtonLeft", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("ButtonTop", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("ButtonWidth", $ELSCOPE_PUBLIC, -1)
    $oClassObject.AddProperty("ButtonHeight", $ELSCOPE_PUBLIC, -1)

    Return $oClassObject.Object
EndFunc ;==>_GUICreator

Func _GUI_Create($oSelf)
    Local $title = $oSelf.GUITitle
    Local $width = $oSelf.GUIWidth
    Local $height = $oSelf.GUIHeight
    Local $top = $oSelf.GUITop
    Local $left = $oSelf.GUILeft

    GUICreate($title, $width, $height, $left, $top)
EndFunc ;==>_GUI_Create

Func _GUI_Button($oSelf)
    Local $btnText = $oSelf.ButtonText
    Local $btnLeft = $oSelf.ButtonLeft
    Local $btnTop = $oSelf.ButtonTop
    Local $btnWidth = $oSelf.ButtonWidth
    Local $btnHeight = $oSelf.ButtonHeight

    Return GUICtrlCreateButton($btnText, $btnLeft, $btnTop, $btnWidth, $btnHeight)
EndFunc ;==>_GUI_Button

Func _ErrFunc()
    ConsoleWrite("! COM Error ! Number: 0x" & Hex($oError.number, 8) & " ScriptLine: " & $oError.scriptline & " - " & $oError.windescription & @CRLF)
EndFunc ;==>_ErrFunc
Edited by jaberwocky6669
Link to comment
Share on other sites

  • 1 month later...
whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

ps: Why it this not working. Just wondering what I'm missing. (not fermiliar with (AutoIt) Com objects)

$self.propertie += 1

This is an AutoIt-limitation we cannot overcome, it is not implemented in the interpreter.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

ps: Why it this not working. Just wondering what I'm missing. (not fermiliar with (AutoIt) Com objects)

$self.propertie += 1

This is an AutoIt-limitation we cannot overcome, it is not implemented in the interpreter.

So does this mean that you'd have to do:

$self.propertie = $self.propertie + 1

?

James

Link to comment
Share on other sites

@MvGulik:

to question 1: Both create the same oObject.

to number 2: the parent must always be an object. The properties and functions of this object will be copied to the new one.

Edit: Personally, i don't need _AutoItObject_Class since it does only wrap _AutoItObject_Create and all _AutoItObject_Add... in object-style.

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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