reference post
https://www.autoitscript.com/forum/topic/202618-implementing-irunningobjecttable-interface/?do=findComment&comment=1525707
Main.au3
#include "RegisterActiveObject UDF3.au3"
__ExampleA()
Func __ExampleA()
Local $s_Clsid
Local $o_object = __RegisterActiveObject(Default, $s_Clsid)
If @error Or Not IsObj($o_object) Then Return
Local $aArray[2] = ["Item A0", "item A1"]
$o_object.add("String", 'Apple')
$o_object.add("Number", 12345)
$o_object.add("Array", $aArray)
ConsoleWrite('$o_object -> Count item: ' & $o_object.Count & @CRLF)
RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & '"Client.au3" ' & $s_Clsid)
ConsoleWrite('$o_object -> Count item: ' & $o_object.Count & @CRLF)
__RevokeActiveObject()
EndFunc
Client.au3
MsgBox( 0, "Client", "Client Started" )
__Client($CmdLine[1])
Func __Client($o_Clsid)
Local $m_object = ObjGet("", $o_Clsid)
If Not IsObj($m_object) Then Return
MsgBox(0, "Client", '$m_object -> Count item: ' & $m_object.Count)
$m_object.add("Double", 567.55)
MsgBox( 0, "Client", "client End" )
EndFunc
for connect to vbscipt change this line of Main.au3
RunWait( @AutoItExe & " /AutoIt3ExecuteScript " & '"Client.au3" ' & $s_Clsid)
to
RunWait( 'wscript.exe "Client.vbs" ' & ObjName($o_object, 3))
Client.vbs
Dim Arg
Arg = WScript.Arguments(0)
Set M_object = GetObject(, Arg)
msgbox VarType(M_object) & " " & TypeName(M_object)
msgbox M_object.Count
M_object.Add "Double", 567.55
Set M_object = Nothing
RegisterActiveObject UDF2.au3
RegisterActiveObject UDF3.au3