Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

$oTypelib=objcreateinterface($tp, $IID_TYPELIB, $tagITypeLib)

$
0
0
Wondering if by using the new beta AutoIt if by using
$oTypelib=objcreateinterface($tp, $IID_TYPELIB, $tagITypeLib)
you can analyse the typelib of a file

I tried below but (again) missing the point


;~ IID´s
$IID_TYPEINFO="{00020401-0000-0000-C000-000000000046}"
$IID_TYPELIB="{00020402-0000-0000-C000-000000000046}"

;~ Methods of interface ITypelib
$tagITypeLib = "GetTypeInfoCount long();" & _
"GetTypeInfo long(uint;ptr);" & _
"GetTypeInfoType long(uint;ptr);" & _
"GetTypeInfoOfGuid long(ptr;ptr);" & _
"GetLibAttr long(ptr);" & _
"GetTypeComp long(ptr);" & _
"GetDocumentation long(int;ptr;ptr;ptr;ptr);" & _
"IsName long(ptr;ulong;ptr);" & _
"FindName long(ptr;ulong;ptr;ptr;ptr);" & _
"ReleaseTLibAttr long(ptr);"

;~ The file where the type library has to be analysed
$szFile="C:\Windows\System32\UIAutomationCore.dll"
;~ $szFile = FileOpenDialog("Open Type Library", "", "TypeLib Files (*.tlb;*.olb;*.dll;*.ocx;*.exe)|All Files (*.*)", 1)

Local $oleAutDll = DllOpen("oleaut32.dll")

;~ Just load the typelibrary
;~ try 1
$tp = DllStructCreate("ptr")
$result=DllCall($oleAutDll, "ulong", "LoadTypeLib", "wstr", $szFile, "ptr", DllStructGetPtr($tp, 1))

;~ try 2
;~ $tp = ""
;~ $result=DllCall($oleAutDll, "ulong", "LoadTypeLib", "wstr", $szFile, "ptr", $tp)

consolewrite("LoadTypeLib result: "& $result & " error: " & @Error & @crlf)

;~ Try to get the object interface
$oTypelib=objcreateinterface($tp, $IID_TYPELIB, $tagITypeLib)

if isobj($oTypelib) Then
consolewrite("We have the typelib object")
EndIf



I know there are alternatives for analysing typelib but just wondering if this could work with objcreateinterface

http://www.autoitscript.com/forum/topic/114498-typelibinspector-oleview-was-yesterday
http://www.autoitscript.com/forum/topic/112992-tliau3-type-information-on-com-objects-tlbinf-emulation
http://www.autoitscript.com/forum/topic/54227-com-object-browser

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>