junkew Posted January 30, 2013 Share Posted January 30, 2013 Wondering if by using the new beta AutoIt if by using$oTypelib=objcreateinterface($tp, $IID_TYPELIB, $tagITypeLib)you can analyse the typelib of a fileI tried below but (again) missing the pointexpandcollapse popup;~ 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") EndIfI know there are alternatives for analysing typelib but just wondering if this could work with objcreateinterface FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted February 1, 2013 Author Share Posted February 1, 2013 Did get it to work with objcreateinterface expandcollapse popup;~ IID´s $IID_TYPEINFO="{00020401-0000-0000-C000-000000000046}" $IID_TYPELIB="{00020402-0000-0000-C000-000000000046}" Global $tp ;~ 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 $result = DllCall("user32.dll", "int", "MessageBox", "hwnd", 0, "str", "Some text", "str", "Some title", "int", 0) Global Const $oleAutDll = DllOpen("oleaut32.dll") ;~ Just load the typelibrary ;~ try 1 $tp = DllStructCreate("ptr") $result=DllCall($oleAutDll, "ulong", "LoadTypeLib", "wstr", $szFile, "ptr", DllStructGetPtr($tp, 1)) $tp =DllStructGetData($tp, 1) 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" & @crlf) consolewrite("Count: " & $oTypelib.GetTypeInfoCount & @crlf) EndIf FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now