Jump to content

AU3Automation - export AU3 scripts via COM interfaces


doudou
 Share

Recommended Posts

Error: Could not create object named "AU3Aut.Scriptlet"

Code: 80040154

Source: WScript.CreateObject

Either of the demos - the one you posted and the one in the download.

Link to comment
Share on other sites

Either of the demos - the one you posted and the one in the download.

You said: "now it doesn't work". Did it work before? If yes what has changed since?

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

Link to comment
Share on other sites

Hmm... it looks like registration has failed. Could you try

regsvr32 /u AU3Aut.dll
regsvr32 AU3Aut.dll

in the directory where the DLL is located?

If it still shows the same error, please search your registry for "IScriptlet". It should point to TypeLib {4B304573-9212-44C3-A6A3-4A7B2E465AFE}, different TypeLib GUID indicates that there's a name clash with some other COM component. (I admit, "IScriptlet" isn't very lucky choice for the name of an interface and I'm going to change this in the next release.)

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

Did that, unregistered and reregistered, and it didn't work. Checked the registry, the entry is correct as per your thoughts.

Could this be an OS issue?

Link to comment
Share on other sites

Could this be an OS issue?

What OS do you run?

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

Windows 7 x64. Sorry - I'd posted that earlier, but overwrote it in an edit. I'm not batting 1000 today, lol

Link to comment
Share on other sites

Windows 7 x64. Sorry - I'd posted that earlier, but overwrote it in an edit. I'm not batting 1000 today, lol

Yeah, right. AU3Aut.dll is 32bit, so it registers only for 32bit clients. Unfortunately I don't have a 64bit machine, so I can't tell you (for the moment) what to do to make WSH64 load the object... but check out later - I'm on it.

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

If AU3Aut.dll is 32bit the make sure you run 32bit AutoIt.

From SciTE (full) that is done by adding #AutoIt3Wrapper_UseX64=n directive at top of the script.

Registering server is another thing. You don't need regsvr32 because it can be done in much more simpler and at the same time advanced way.

Two functions can be written and used in the scripts:

Func _AU3Aut_Register($sDllPath = "AU3Aut.dll", $sClassName = "AU3Aut.Scriptlet")
    ObjCreate($sClassName)
    If @error Then
        DllCall($sDllPath, "long", "DllRegisterServer")
        ObjCreate($sClassName) ; it's safer this way than to check return of DllRegisterServer.
        If @error Then
            ShellExecuteWait(@AutoItExe, '/AutoIt3ExecuteLine  "DllCall(''' & $sDllPath & ''', ''long'', ''DllRegisterServer'')"', "", "runas")
            ObjCreate($sClassName)
            If @error Then Return SetError(1, 0, False)
            Return True
        EndIf
        Return True
    EndIf
    Return True
EndFunc   ;==>_AU3Aut_Register

Func _AU3Aut_UnRegister($sDllPath = "AU3Aut.dll", $sClassName = "AU3Aut.Scriptlet")
    ObjCreate($sClassName)
    If @error Then Return True
    DllCall($sDllPath, "long", "DllUnregisterServer")
    ObjCreate($sClassName)
    If @error Then Return True
    ShellExecuteWait(@AutoItExe, '/AutoIt3ExecuteLine  "DllCall(''' & $sDllPath & ''', ''long'', ''DllUnregisterServer'')"', "", "runas")
    ObjCreate($sClassName)
    If @error Then Return True
    Return SetError(1, 0, False)
EndFunc   ;==>_AU3Aut_UnRegister

First few lines of the servers could then be:

If Not _AU3Aut_Register() Then
    If @AutoItX64 Then
        MsgBox(64 + 262144, "Error", "Incompatible interpreter." & @CRLF & "32-bit AutoIt required")
    Else
        MsgBox(64 + 262144, "Register", "Registering server is required.")
    EndIf
EndIf

As for VBS. If run through SciTE, correct version of the VBS interpreter would be run because SciTE is 32-bit app.

Edited by trancexx
Link to comment
Share on other sites

Registering server is another thing. You don't need regsvr32 because it can be done in much more simpler and at the same time advanced way.

Two functions can be written and used in the scripts:

...

First few lines of the servers could then be:

If Not _AU3Aut_Register() Then
    If @AutoItX64 Then
        MsgBox(64 + 262144, "Error", "Incompatible interpreter." & @CRLF & "32-bit AutoIt required")
    Else
        MsgBox(64 + 262144, "Register", "Registering server is required.")
    EndIf
EndIf

Thx for helping out, trancexx.

_AU3Aut_Register() would be surely convenient for the users and I may add it in the next release. However, the idea to call _AU3Aut_Register() in the server script is a bit shortsighted (sorry): the point is the AU3Aut.dll has to be registered for the client and that before the first call on CreateObject("AU3Aut.Scriptlet") has been made, otherwise server script wouldn't be run at all.

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

However, the idea to call _AU3Aut_Register() in the server script is a bit shortsighted (sorry): the point is the AU3Aut.dll has to be registered for the client and that before the first call on CreateObject("AU3Aut.Scriptlet") has been made, otherwise server script wouldn't be run at all.

Yes, of course.
Link to comment
Share on other sites

Just released 1.0.3 version with 64 bit server DLL and renamed IScriptlet interface. Also registration script (thanks to trancexx) is on board to ease hassle with regsvr32 on different platforms.

I only have access to a 64bit OS at work, thus it's unclear when I come to test the AU3Aut64.dll properly - all feedback from early adopters is very welcome.

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 only have access to a 64bit OS at work, thus it's unclear when I come to test the AU3Aut64.dll properly - all feedback from early adopters is very welcome.

Right on it, boss.

Link to comment
Share on other sites

Seems to work, however, it just loads the test script into scite. I'm assuming I have to set the AutoIt default behavior to run instead of open in Scite.

Is there a way to override that?

Link to comment
Share on other sites

Seems to work, however, it just loads the test script into scite. I'm assuming I have to set the AutoIt default behavior to run instead of open in Scite.

Is there a way to override that?

This is a bit of a problem: AU3Aut has to deal with AU3 and EXE files so it just calls ShellExecute with the default verb associated with it. I considered FindExecutable and alike but didn't found a satisfactory universal solution yet that wouldn't complicate (and slow down) the loading procedure over limits.

Does it work, if you make "run" the default?

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

It seems to work as far as loading the object. The vbs loads but then displays:

OpenFileDialog returns [], error was 2

I'm testing other stuff, looks like there's still some issues (probably on my side.)
Link to comment
Share on other sites

This looks correct: if you click "Cancel" in the FileOpenDialog() it returns "" and sets error to 2. Try to select some file and push "Ok".

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

No file dialog appears from which to select; Running the included 1.0.2 example, however, returns everything it should, but randomly fails. First impression is that it's failing because I'm clicking too fast, or losing focus, or something of that nature.

The error message received is usually after au3.testfunc1 or testfunc2.

Line 26, char 1, Object doesn't support this property or method.

Code 800A01B6 Microsoft VBScript runtime error.

After the error popup, it exits the function.

Thanks, doudou, definitely making progress here. :idea:

Edited by JRowe
Link to comment
Share on other sites

No file dialog appears from which to select;

Sorry, my bad, error = 2 means: "Bad file filter", it's either dialog.filter was really invalid or it gets scrambled. Try adding MsgBox showing the content of $filter variable in Func Show().

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

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