Jump to content

AutoItObject UDF


ProgAndy
 Share

Recommended Posts

It doesn't mean that. It's fourth element of the array, not third.

Third would be number of bytes you specify to write.

I meant from the perspective of the method signature where there are only three arguments, but I understand your point. However, the strange effect is still unexplained.

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

IStream.Write() accepts the call and returns number of bytes correctly in the third parameter (meaning ULONG* is apparently a legal pointer here) but in the same time it messes up the buffer in the first parameter.

It does not mean ULONG* is legal. One of the AIO devs would have to comment on their code, but I'm fairly certain it's an uncaught (or unreported) error. The doc says DllCall 'type of parameter', not DllCall syntax. * is syntax, not type. So my previous comments stand. Just don't do it. You have the correct interface declaration working, stop trying to figure out why your incorrect declaration is not working.

And yes, in the context of this thread, all this is a load of crap. This thread is for discussing AIO itself, not your specific interface implementation. It should be moved elsewhere.

Link to comment
Share on other sites

  • 2 weeks later...

Could somebody from the glorious AIO team help me with the following problem: if I want to access directly IDispatch on a living AutoIt object (i.e. result of ObjCreate()) is it possible with AIO?

My effort so far:

#include "AutoItObject.au3"

Global $oError = ObjEvent("AutoIt.Error", "_ErrFunc")
Func _ErrFunc()
    ConsoleWrite("! COM Error !  Number: 0x" & Hex($oError.number, 8) & "   ScriptLine: " & $oError.scriptline & " - " & $oError.description & " (" & $oError.windescription & ")" & @CRLF)
    Return
EndFunc   ;==>_ErrFunc

_AutoItObject_Startup()

Dim $obj = ObjCreate("Scripting.Dictionary")
ConsoleWrite("Accessing " & ObjName($obj) & @LF)

Dim $tagIUnknown = "QueryInterface;" & _
            "AddRef;" & _
            "Release;"
Dim $tagIDispatch = $tagIUnknown & _
            "GetTypeInfoCount;" & _
            "GetTypeInfo;" & _
            "GetIDsOfNames;" & _
            "Invoke;"

Dim $pDisp = _AutoItObject_IDispatchToPtr($obj)
If $pDisp Then
    Dim $objDisp = _AutoItObject_WrapperCreate($pDisp, $tagIDispatch)
    If IsObj($objDisp) Then
        ConsoleWrite("_AutoItObject_WrapperCreate() success" & @LF)
        Dim $tp = DllStructCreate("UINT")
        Dim $hr = $objDisp.GetTypeInfoCount("long", "ptr", Number(DllStructGetPtr($tp, 1)))
        ConsoleWrite("GetTypeInfoCount() returned: " & $hr[0] & ", ctinfo: " & DllStructGetData($tp, 1) & @LF)
    Else
        ConsoleWrite("_AutoItObject_WrapperCreate() failed" & @LF)
    EndIf
    $objDisp = 0
Else
    ConsoleWrite("_AutoItObject_IDispatchToPtr() failed" & @LF)
EndIf

The script seems to do as intended but AutoIt crashes on exit with access violation:

Exception Information
Code: 0xc0000005    Flags: 0x00000000
Record: 0x0000000000000000  Address: 0x00000000770f4945
System Information
Windows NT 5.1 Build: 2600
CPU Vendor Code: 756E6547 - 49656E69 - 6C65746E
CPU Version: 000006FD  CPU Feature Code: BFEBFBFF
CPU AMD Feature Code: 00C7E824
Module 1
AutoIt3.exe
Image Base: 0x00400000  Image Size: 0x00000000
Checksum: 0x000c1865    Time Stamp: 0x4b509352
Version Information
 Signature: feef04bd
 StrucVer:  00010000
 FileVer:   (3.3:4.0)
 ProdVer:   (3.3:4.0)

Am I overlooking something (again)?

Edit:

I think I figured that out, adding

_AutoItObject_IUnknownAddRef($pDisp)
after _AutoItObject_WrapperCreate() call eliminates the crash. Looks logical. Any comments are appreciated nevertheless. Edited by doudou

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

Any chance you can provide the EXE in English too please?

Thanks,

James

Sorry, my WinRAR is not able to generate an english exe or I missed anoption. Anyways, it is not too difficult to understand the extractor:

Annehmen -> accept license

Ablehnen -> decline (refuse?) license

Installieren -> Install (not really, only extract)

Abrechen -> Cancel

Durchsuchen -> Browse for folder

Everything else should be in English or is not important.

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

I know I can use another software, I just thought the archive-exe would be language independent. The next time I (or someone else creating the release) will use something else.

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

I just can't find the answer:

How do I declare type VARIANT (no pointer) for a return type of an interface method wrapped with _AutoItObject_WrapperCreate()?

Let's say the method is defined in the IDL like this:

VARIANT Keys();

What would be the representation of it in $tagInterface [_AutoItObject_WrapperCreate()] or in $sReturnType [_AutoItObject_WrapperAddMethod()]? "variant" as such doesn't seem to be a valid DllCall type but there are plenty of COM interfaces out there that use this as return type and AutoIt has to have some built-in handling for it, does AIO then?

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

I just can't find the answer:

How do I declare type VARIANT (no pointer) for a return type of an interface method wrapped with _AutoItObject_WrapperCreate()?

Let's say the method is defined in the IDL like this:

VARIANT Keys();

What would be the representation of it in $tagInterface [_AutoItObject_WrapperCreate()] or in $sReturnType [_AutoItObject_WrapperAddMethod()]? "variant" as such doesn't seem to be a valid DllCall type but there are plenty of COM interfaces out there that use this as return type and AutoIt has to have some built-in handling for it, does AIO then?

What COM interface method returned variant and AutoIt handled that internally giving you the 'value'?

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

What COM interface method returned variant and AutoIt handled that internally giving you the 'value'?

In particular I was trying to access a third party component that exports only dispinterfaces, they have some propgets with VARIANT as return value. When AutoIt loads an object with similar interface f.i. ObjCreate("Scripting.Dictionary"), it looks like it transparently converts the returned VARIANT to AutoIt type.

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

You would have to use "ptr" and _AutoItObject_VariantRead() (for example) with wrapper.

Thaks trancexx, I'll try that.

@AIO team: I can't login anymore at http://autoitobject.origo.ethz.ch. Has something gone wrong on the site or did somebody just delete my account? I have to know that because if it was just an error I'd re-register, which would make no sense if I am unwanted there.

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

Why would you be unwanted?!?

Sometimes one wouldn't know and I hate getting on somebody else's nerves though it looks different from time to time...

:(

The whole Origo is choking on something currently.

So what would you say, do I re-register or just wait up?

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

I think everything is ok now.

Ok, I can login again now. But "everything" doesn't look ok, after submitting a comment on an issue I got:

* warning: array_merge() [function.array-merge]: Argument #1 is not an array in /var/lib/origo-web/drupal/sites/all/modules/issue_tracker/comment.inc on line 410.
    * warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/lib/origo-web/drupal/sites/all/modules/issue_tracker/comment.inc on line 410.
    * warning: Invalid argument supplied for foreach() in /var/lib/origo-web/drupal/sites/all/modules/issue_tracker/comment.inc on line 413.

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

  • 2 weeks later...
  • 3 weeks later...

A new release is out!

The new release 1.1.0 contains BugFixes, includes a DLLStruct-Object (quite similar to AIOStruct) and has an optimized size.

The download is still located in the first post

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