Jump to content



Photo

AutoItObject UDF


  • Please log in to reply
312 replies to this topic

#41 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 February 2010 - 02:56 PM

I'll post to the issue tracker when I get a chance, but I'll post the bug here now.

The Linked List example does not decrement the list size in the remove method.





#42 Melba23

Melba23

    Yes, me!

  • Moderators
  • 15,353 posts

Posted 23 February 2010 - 03:41 PM

trancexx,

Following on from wraithdu's post above, the first line of au3.UserUdfs.properties should read:

au3.keywords.user.udfs=

and then it follows the same structure as all the other properties files with \ as the EOL marker and a TAB at the beginning of each new line.

M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox

Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs

Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames

GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes

ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display

RecFileListToArray - An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options

GUIListViewEx - Insert, delete, move, drag and sort ListView items


#43 doudou

doudou

    reverse engineer, the evil twin of the obverse decomposer

  • Active Members
  • PipPipPipPipPipPip
  • 335 posts

Posted 23 February 2010 - 04:40 PM

Really non-trivial!

You should though have mentioned somewhere that use of inline binary DLL (which is the default) requires AutoIt 3.3.4, as 3.3.2 and earlier would crash at start-up:
AutoitObject.au3 (1195) : ==> String missing closing quote.

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

#44 ProgAndy

ProgAndy

    You need AutoItObject

  • MVPs
  • 2,508 posts

Posted 23 February 2010 - 04:47 PM

Oh, we didn't consider older AutoIt-versions :mellow:

Edited by ProgAndy, 23 February 2010 - 04:47 PM.

*GERMAN* Posted Image [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

#45 doudou

doudou

    reverse engineer, the evil twin of the obverse decomposer

  • Active Members
  • PipPipPipPipPipPip
  • 335 posts

Posted 23 February 2010 - 05:16 PM

Oh, we didn't consider older AutoIt-versions :(

There are worse things :lol:
Some lazy people out there just skip every 2nd version update :mellow: ... and get then what they deserve: compiler errors!
UDFS:Apps:Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE

#46 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,191 posts

Posted 23 February 2010 - 05:29 PM

There are some functions that are written for 3.3.6 or 7 or 8 :mellow:
Obviously they are left out.

eMyvnE


#47 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 February 2010 - 06:33 PM

I've update my previous post with better calltip\highlighting info.

#48 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 23 February 2010 - 11:01 PM

Bah... just realized you can't use this from within any callbacks. I had this problem when I was first writing my ToggleButton UDF. If you try to call a callback from within a callback (like using SendMessage from a mouse hook to a subclassed button -> two AutoIt callbacks, or calling an AutoItObject method from a subclassed button's window procedure) then AutoIt freaks out and deadlocks.

Dammit... my UDF was so much prettier and easy to use in OO.

#49 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,191 posts

Posted 23 February 2010 - 11:22 PM

Bah... just realized you can't use this from within any callbacks. I had this problem when I was first writing my ToggleButton UDF. If you try to call a callback from within a callback (like using SendMessage from a mouse hook to a subclassed button -> two AutoIt callbacks, or calling an AutoItObject method from a subclassed button's window procedure) then AutoIt freaks out and deadlocks.

Dammit... my UDF was so much prettier and easy to use in OO.

The problem is described in the FAQ.

Btw, should this work (answer on blind)?
AutoIt         
#include "AutoitObject.au3" ; First callback $hCallback1 = DllCallbackRegister("_FirstFunction", "none", "") $pCallback1 = DllCallbackGetPtr($hCallback1) ; Second callback $hCallback2 = DllCallbackRegister("_SecondFunction", "none", "") $pCallback2 = DllCallbackGetPtr($hCallback2) ;_FirstFunction() __Au3Obj_PointerCall("none", $pCallback1) Func _FirstFunction()     MsgBox(64, "First", "From first function first time.")     __Au3Obj_PointerCall("none", $pCallback2)     MsgBox(64, "First", "From first function second time.") EndFunc Func _SecondFunction()     MsgBox(64, "Second", "From second function.") EndFunc

eMyvnE


#50 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 24 February 2010 - 12:06 AM

No, it shouldn't. I was going to put together a similar reproducer. Just got home...

#51 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 24 February 2010 - 12:11 AM

But apparently it does...

I guess my deadlock has to do with the callbacks blocking AutoIt's message queue, while your example (and my new test) don't have a message queue to block.

So, no AIO with message processing callbacks... shame.

*snip*

Edited by wraithdu, 24 February 2010 - 12:40 AM.


#52 monoceres

monoceres

    asdf

  • MVPs
  • 3,719 posts

Posted 24 February 2010 - 12:30 AM

Come on! Read the FAQ :mellow:
Posted ImageIs the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3

#53 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 24 February 2010 - 12:42 AM

I did read... and apparently forgot since yesterday.

Anyway, I understand the ByRef limitation, but that doesn't mean a ptr/hwnd type should be illegal. What if I want to store a window handle or some pointer in a property? I can't do $obj.prop = GUICtrlGetHandle($id). Yes, I could do Number($ptr), but that's beside the point.

Edited by wraithdu, 24 February 2010 - 12:45 AM.


#54 monoceres

monoceres

    asdf

  • MVPs
  • 3,719 posts

Posted 24 February 2010 - 12:46 AM

It's not our fault. The COM-error you're getting is thrown by autoit immediately, before control reaches AutoItObject. It seems that autoit simple doesn't have any code to handle pointers (which really is no different from integers, just different flags).

Annoying to say at least.

Edit: There is a ticket on the subject.

Edited by monoceres, 24 February 2010 - 12:48 AM.

Posted ImageIs the link in my post broken? I do not longer own my domain, all the files are moved to my new domain.Example: http://monoceres.se/test.au3 -> http://andhen.mine.nu/monoceres.se/test.au3

#55 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 24 February 2010 - 01:50 AM

Huh, bummer. Well, nothing to be done at the moment then.

#56 UberNuss

UberNuss

    Seeker

  • Active Members
  • 15 posts

Posted 24 February 2010 - 02:19 AM

Eureka! :mellow:

I remember discussing with DaleHolm about this sort of functionality for AutoIt. He said AutoIt would probably never have it. As a famously lesser nerd than he is, I did not argue against his prediction, but only sighed that it can never be.

Top job!

I wonder, would AutoItObject be useful for database construction - and what would be the pro's and con's to this use of AutoItObject ?
Das Häschen benutzt Radar.

#57 wraithdu

wraithdu

    I am less fun than a twisted ankle.

  • MVPs
  • 2,137 posts

Posted 24 February 2010 - 05:31 AM

I found something puzzling regarding the callback deadlocks I was experiencing. For whatever reason, I can successfully call a method in my subclassed button's window procedure as long as I call it from the Switch statement for a specific message, such as the WM_LBUTTONUP case. However if I try to call the same method as the first line of the callback (before the Switch statement), then it deadlocks.

That doesn't make sense to me. Calling a method from anywhere within the callack should have the same result, right?

#58 trancexx

trancexx

    Hm, I really shouldn't.

  • Active Members
  • PipPipPipPipPipPip
  • 5,191 posts

Posted 24 February 2010 - 07:40 AM

I found something puzzling regarding the callback deadlocks I was experiencing. For whatever reason, I can successfully call a method in my subclassed button's window procedure as long as I call it from the Switch statement for a specific message, such as the WM_LBUTTONUP case. However if I try to call the same method as the first line of the callback (before the Switch statement), then it deadlocks.

That doesn't make sense to me. Calling a method from anywhere within the callack should have the same result, right?

I guess only someone who knows how the callbacks are implemented in AutoIt could give you the answers you seek.
How would you implement it?

That code I posted above. What if I somewhere in it do something like this:
$tBin = DllStructCreate("byte[96]", $pCallback1) ConsoleWrite(DllStructGetData($tBin, 1) & @CRLF)
Well, I tried that and got this:
0x558BEC83EC10895DF4BA48F003038955FCBA58F003038955F88B4A0C83F900742B83C2308D5D088B421083F804740E8B03890283C3048B03894204EB048B03890249740883C30483C218EBDB8B55FC52B80809E300FFD08B5DF48BE55DC3040
I have no idea what I'm getting there :mellow:
For example I could assume it's something I could organize into something like this:
Spoiler

But then again, what's that???
Maybe if I split it in some kind of logical blocks:
Spoiler

What if I add comments...
Spoiler

I don't know. It's above me. I don't even know what that means.

Nevertheless I could, considering conditions, switch execution to another thread:
AutoIt         
#include <WinAPI.au3> #include "AutoitObject.au3" $hGui = GUICreate("") $hButtonMsgBox = GUICtrlCreateButton("Msgbox", 100, 100, 100, 30) $hButtonCall1 = GUICtrlCreateButton("Call", 100, 300, 100, 30) GUISetState(@SW_SHOW, $hGui) ; First callback $hCallback1 = DllCallbackRegister("_FirstFunction", "none", "") $pCallback1 = DllCallbackGetPtr($hCallback1) ; Second callback $hCallback2 = DllCallbackRegister("_SecondFunction", "none", "") $pCallback2 = DllCallbackGetPtr($hCallback2) Global $hThread While 1     Switch GUIGetMsg()         Case -3             Exit         Case $hButtonMsgBox             MsgBox(64, "Title", "Text")         Case $hButtonCall1             ;GUISetState(@SW_HIDE, $hGui)             $hThread = _Thread_PointerCall($pCallback1) ; call, but this time in another thread             ;_WinAPI_WaitForSingleObject($hThread)             Beep(1200, 1200)             ;GUISetState(@SW_SHOW, $hGui)     EndSwitch WEnd Func _FirstFunction()     MsgBox(64, "First", "From first function first time.")     _SecondFunction()     MsgBox(64, "First", "From first function second time.") EndFunc Func _SecondFunction()     MsgBox(64, "Second", "From second function.") EndFunc Func _Thread_PointerCall($pAddress)     Local $aCall = DllCall("kernel32.dll", "ptr", "CreateThread", _             "ptr", 0, _             "dword", 0, _             "ptr", $pAddress, _             "ptr", 0, _             "dword", 0, _             "dword*", 0)     Return $aCall[0] EndFunc

What's happening to original thread (and messages) while the another one is running?

Edited by trancexx, 24 February 2010 - 01:59 PM.

eMyvnE


#59 James

James

    jbrooksuk

  • MVPs
  • 9,470 posts

Posted 25 February 2010 - 07:15 PM

This is amazing! I'm re-writing some of the code I've written before to include AU3O (?) and it's been fun! It's weird using Object like code in AutoIt, but such awesomness Posted Image

Cheers so much for this :mellow:

James

#60 JRowe

JRowe

    Chasing the white rabbits

  • Active Members
  • PipPipPipPipPipPip
  • 1,764 posts

Posted 25 February 2010 - 09:37 PM

Maybe AUOO? Got a wolf howl thing going on, there. :mellow:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users